Skip to main content

TopNavigation

TopNavigation is a heading component designed for screen headers. It supports a title, subtitle, alignment options, and left/right action accessories.

Import

import { TopNavigation, TopNavigationAction } from '@ui-kitten/components';

Basic Usage

import React from 'react';
import { Layout, TopNavigation, TopNavigationAction, Icon } from '@ui-kitten/components';

const BackAction = () => (
<TopNavigationAction icon={(props) => <Icon {...props} name="arrow-back" />} />
);

const TopNavigationExample = () => (
<Layout style={{ flex: 1 }}>
<TopNavigation
title="Screen Title"
subtitle="Subtitle"
alignment="center"
accessoryLeft={BackAction}
accessoryRight={() => (
<TopNavigationAction icon={(props) => <Icon {...props} name="more-vertical" />} />
)}
/>
</Layout>
);

Props

TopNavigation

PropertyTypeDefaultDescription
titleReactText | (props) => ReactElementundefinedTitle text or render function.
subtitleReactText | (props) => ReactElementundefinedSubtitle text or render function.
alignment'start' | 'center''start'Title alignment within the navigation bar.
accessoryLeft() => ReactElementundefinedRender function for the left accessory (e.g., back action).
accessoryRight() => ReactElementundefinedRender function for the right accessory (e.g., menu action).

TopNavigationAction

PropertyTypeDefaultDescription
icon(props) => ReactElement-Render function for the action icon.
onPress() => voidundefinedCalled when the action is pressed.

Storybook

Live examples coming soon via Storybook.