Closed Vasault closed 3 years ago
👋 there. Just tried running same code and the answer is yes, you can. And even in 2 variations.
Passing a fill
property, just like you did. Notice it's passed after we do spreading of the inherited props.
const CalendarOutlineIcon = (props: IconProps): IconElement<ImageProps> => (
<Icon {...props} fill='red' name='calendar-outline' />
);
Passing a style prop with a tintColor
property. Notice we use style
from the inherited props as well.
const CalendarOutlineIcon = (props: IconProps): IconElement<ImageProps> => (
<Icon {...props} style={[props.style, { tintColor: 'blue' }]} name='calendar-outline' />
);
Advice
It's recommended to use status
property instead of using conditional colors. You may pass status='danger'
to change the border and the rest colors of the Input. It's also possible to define status colors in case standard Eva colors do not fit.
<Input status={isEmailValid ? 'basic' : 'danger'} />
thank you, it worked :)
Hi guys, i just wanted to know if is possible to stylize the eva icon inside ui kitten input like this.
where isEmailValid is an boolean state, whenever i validate my mail i toggle that state so that the icon color changes inside the input.
my main issue with this, is that since the color of the icon is based on the text color of the input, is taking the color of my text, which is a darker grey compared to what i'm looking for
as you can see in this image, it stays in the same color no matter what.