TopNav

TopNavigation provides a heading component for a page/screen.

topNavMid

Usage#

Simple Usage#

You can simply put your title or your logo on middleContent

topNavMid

import { Layout, TopNav } from 'react-native-rapi-ui';
<Layout>
<TopNav middleContent="Home" />
</Layout>;

Left or Right Content#

You can add a content on left or right you can give it an action (onPress) too.

topNavLefttopNavRight

import { Layout, TopNav } from 'react-native-rapi-ui';
<Layout>
<TopNav
leftContent={<Ionicons name="chevron-back" size={20} color={theme.black} />}
leftAction={() => console.log('back icon pressed')}
middleContent="Profile"
/>
<TopNav
rightContent={
<Ionicons name="ellipsis-vertical" size={20} color={theme.black} />
}
rightAction={() => console.log('setting icon pressed')}
middleContent="Settings"
/>
</Layout>;

Properties#

propsrequiredvalueDefault Value
ViewProps
heightNonumber64
backgroundColorNostring#FFFFFF
borderColorNostring#c0c0c0
leftContentNostring or React.ReactNode
middleContentNostring or React.ReactNode
rightContentNostring or React.ReactNode
leftActionNoVoidFunction
middleActionNoVoidFunction
rightActionNoVoidFunction
leftTextStyleNoTextStyle
middleTextStyleNoTextStyle
rightTextStyleNoTextStyle