gluestack

gluestack Logogluestack

How can i set the label's text color of SelectItem

baimiaoknight posted this in #support
Open in Discord
Avatar
baimiaoknightOP
<SelectItem
key={index}
label={item.name}
value={item.content}
mb={'$1'}
// bgColor={brandColorWithOpacity(0.1)}
// // onPress={() => onChangeSelected(item.content)}
style={{
borderBottomWidth: 1,
borderBottomColor: brandColorWithOpacity(0.3),
}}
/>
How can i set the label's text color of SelectItem

14 Replies

Avatar
sravankumar101
hey @baimiaoknight , for native you can use color prop to change the color of label text.
Avatar
baimiaoknightOP
I use the version is "@gluestack-ui/themed": "^1.1.30", on ReactNative ,
<SelectItem
key={index}
label={item.name}
value={item.content}
mb={'$1'}
// bgColor={brandColorWithOpacity(0.1)}
style={{
borderBottomWidth: 1,
borderBottomColor: brandColorWithOpacity(0.3),
}}
color={titleColor}
/> I set the color props , but it is not working for the color
Avatar
sravankumar101
Is it plain react native or expo @baimiaoknight ?
Avatar
baimiaoknightOP
react native
Avatar
sravankumar101
Give us sometime , we will get back to you @baimiaoknight .
Avatar
baimiaoknightOP
ok, thank you
Avatar
sravankumar101
Could you please share your repo here ? @baimiaoknight
Avatar
baimiaoknightOP
I am so sorry, I could not to do that. Can't you reproduce the problem?
This is the code I use
<Select
flex={1}
ml={10}
onValueChange={(value) => onChangeSelected(value)}
>
<SelectTrigger
borderWidth={0}
borderColor={buttonBorderColor}
variant="outline"
size="sm"
height={50}
>
<SelectInput
placeholder="Select option"
textAlign='right'
color={titleColor}
/>
<SelectIcon as={ChevronDownIcon} />
</SelectTrigger>
<SelectPortal>
<SelectBackdrop/>
<SelectContent
// bgColor={cardBgColor2}
borderColor={brandColor}
>
<SelectDragIndicatorWrapper>
<SelectDragIndicator />
</SelectDragIndicatorWrapper>
<SelectSectionHeaderText>
{titleTxt}
</SelectSectionHeaderText>

<SelectScrollView>
{
data.map((item, index) => {
return (
<SelectItem
key={index}
label={item.name}
value={item.content}
mb={'$1'}
// bgColor={brandColorWithOpacity(0.1)}
style={{
borderBottomWidth: 1,
borderBottomColor: brandColorWithOpacity(0.3),
}}
color={titleColor}
/>
)
})
}
</SelectScrollView>
</SelectContent>
</SelectPortal>
</Select>
I use the color props, it has a error
Image
Avatar
viraj1098
Hey @baimiaoknight , We just released a new version with option to style SelectItemText.

use textStyle prop in Select Item to chnages text styling.