Skip to main content

NavigationBar

iOS 26 top navigation bar with standard and large title modes. Supports back button, leading/trailing action buttons, inline segmented controls (iPad), and search accessories.

Import​

import { NavigationBar, ToolbarButton } from '@scaffald/ui';

Basic Usage​

Live Preview
<ThemeProvider initialTheme="light">
<Stack gap={24} style={{maxWidth: 440}}>
  <NavigationBar
    title="Messages"
    subtitle="3 unread"
    backButton={{ label: 'Back', onPress: () => {} }}
    trailingItems={
      <ToolbarButton variant="filled" label="Done" onPress={() => {}} />
    }
  />
</Stack>
</ThemeProvider>

Props​

See the TypeScript definitions for the complete props API.

PropTypeDefaultDescription
titlestringrequiredNavigation bar title
subtitlestring—Optional subtitle below title
showSubtitlebooleantrueWhether to show the subtitle
titleSize'standard' | 'large''standard'Title display size
backButton{ label?, onPress, tintColor? }—Back button configuration
leadingItemsReactNode—Items on the left side
trailingItemsReactNode—Items on the right side
segmentedControlSegmentedControlProps—iPad: inline segmented control
searchAccessorySearchAccessoryProps—iPad: search row below nav
glassbooleanfalseApply glassmorphic background

Common Props​

All NavigationBar components accept standard React Native View props.

Variants​

Standard Title​

Centered title with optional subtitle, back button, and trailing actions.

Live Preview
<ThemeProvider initialTheme="light">
<NavigationBar
  title="Settings"
  backButton={{ label: 'Back', onPress: () => {} }}
  trailingItems={
    <ToolbarButton icon={<Text style={{fontSize: 20}}>{'\u270E'}</Text>} onPress={() => {}} />
  }
/>
</ThemeProvider>

Large Title​

34pt bold title displayed below the nav row, matching iOS large title behavior.

Live Preview
<ThemeProvider initialTheme="light">
<NavigationBar
  title="Settings"
  titleSize="large"
  trailingItems={
    <ToolbarButton variant="text" label="Edit" onPress={() => {}} />
  }
/>
</ThemeProvider>

iPad with Segmented Control​

Replaces center title with a segmented control for tabbed navigation.

Live Preview
<ThemeProvider initialTheme="light">
<NavigationBar
  title="Library"
  backButton={{ onPress: () => {} }}
  segmentedControl={{
    segments: ['Songs', 'Albums', 'Artists'],
    selectedIndex: 0,
    onSelectionChange: () => {},
  }}
/>
</ThemeProvider>

Glass Background​

Applies a translucent glassmorphic background with backdrop blur.

Live Preview
<ThemeProvider initialTheme="light">
<Stack style={{backgroundColor: '#8B5CF6', padding: 0}}>
  <NavigationBar
    title="Photos"
    glass
    backButton={{ label: 'Albums', onPress: () => {} }}
    trailingItems={
      <ToolbarButton variant="text" label="Select" onPress={() => {}} />
    }
  />
</Stack>
</ThemeProvider>

Accessibility​

  • Back button has accessible label
  • Title and subtitle are readable by screen readers
  • Trailing actions are focusable and announce their role
  • Segmented control provides tab semantics

Design Tokens​

This component uses the following design tokens:

  • Colors: colors.labels[theme].primary, colors.labels[theme].secondary
  • Accents: colors.accents[theme].blue for tint colors
  • Typography: 17pt semibold (standard), 34pt bold (large title)
  • Glass: backdrop-filter blur for glassmorphic variant

See Design Tokens for more information.

Changelog​

See GitHub Releases for version history.