React-native-ui-kitten: How to style the TopNavigation title text.

Created on 24 Jun 2020  路  1Comment  路  Source: akveo/react-native-ui-kitten

馃挰 Question

Can the TopNavigation Title be styled? I want to change the color to white while the bar itself is red. Currently I am able to set the background to red but not the color or style of the label.

<TopNavigation title="News" alignment="center" style={styles.topBar} />

.... topBar: { fontSize: 18, fontWeight: "bold", backgroundColor: "#d2232a", color: "#9C27B0", },

UI Kitten and Eva version

| Package | Version |
| ----------- | ----------- |
| @eva-design/eva | 2.0.0 |
| @ui-kitten/components | 5.0.0 |

Help wanted

Most helpful comment

Yes it can, please see the docs for examples.
In a few words, you can pass a component to a title prop instead of passing strings, e.g:
title={props => <Text {...props} style={[props.style, { color: 'red }]}>TITLE</Text>}

>All comments

Yes it can, please see the docs for examples.
In a few words, you can pass a component to a title prop instead of passing strings, e.g:
title={props => <Text {...props} style={[props.style, { color: 'red }]}>TITLE</Text>}

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nonameolsson picture nonameolsson  路  3Comments

betodasilva picture betodasilva  路  3Comments

sobiso picture sobiso  路  3Comments

domsterthebot picture domsterthebot  路  3Comments

MScMechatronics picture MScMechatronics  路  3Comments