Nav Bar
Mobile app bar — back button, title, action icons, and an optional extra row for filters, search, or segmented controls.
Basic Usage
Standard mobile nav bar
Back button on the left, title in the middle, action icons on the right.
import { NavBar, Button } from 'fluxo-ui';
<NavBar
title="Inbox"
subtitle="3 unread"
onBack={goBack}
actions={(
<>
<Button leftIcon={SearchIcon} ariaLabel="Search" layout="plain" />
<Button leftIcon={SettingsIcon} ariaLabel="Settings" layout="plain" />
</>
)}
/>Variants
Standard
Title sits next to the leading area — default layout.
Centered
Title is absolutely centered between leading and actions — iOS-style.
Large title
iOS-style large title rendered on its own row below the toolbar.
Compact
Slim toolbar — pairs well with embedded screens or dense layouts.
Transparent
Use over hero imagery — drop background and border.
<NavBar variant="standard" title="Standard" actions={...} onBack={...} />
<NavBar variant="centered" title="Centered" actions={...} onBack={...} />
<NavBar variant="large" title="Large title" actions={...} />
<NavBar variant="compact" title="Compact" actions={...} onBack={...} />Sub-row content
With segmented sub-row
Pass children to render an extra row below the toolbar — handy for segmented filters or tabs.
With search sub-row
Place a TextInput in children for an inline search experience.
<NavBar
title="Library"
onBack={goBack}
>
<SelectButton variant="segmented" items={...} value={view} onChange={...} />
</NavBar>Import
import { NavBar } from 'fluxo-ui';
import type { NavBarProps, NavBarVariant, NavBarPosition } from 'fluxo-ui';Props
titleReactNodeMain title rendered in the bar (or as a large title when variant='large').
titleReactNodeMain title rendered in the bar (or as a large title when variant='large').
subtitleReactNodeOptional secondary line below the title.
subtitleReactNodeOptional secondary line below the title.
leadingReactNodeElement placed at the start of the bar after the back button (e.g., logo, avatar, menu icon).
leadingReactNodeElement placed at the start of the bar after the back button (e.g., logo, avatar, menu icon).
actionsReactNodeRight-aligned action group (icons, buttons, menus).
actionsReactNodeRight-aligned action group (icons, buttons, menus).
onBack() => voidClick handler for the back button. When provided, the back button is shown automatically.
onBack() => voidClick handler for the back button. When provided, the back button is shown automatically.
backLabelstring"'Back'"Accessible/text label for the back button. Hidden visually on screens below the small breakpoint.
backLabelstring"'Back'"Accessible/text label for the back button. Hidden visually on screens below the small breakpoint.
showBackbooleanForce showing/hiding the back button. Defaults to true when onBack is set.
showBackbooleanForce showing/hiding the back button. Defaults to true when onBack is set.
variant'standard' | 'centered' | 'large' | 'transparent' | 'compact'"'standard'"Visual layout. 'centered' centers the title between leading/actions (iOS-style). 'large' renders an iOS-style large title that collapses on scroll. 'transparent' removes background and border. 'compact' is a slim toolbar.
variant'standard' | 'centered' | 'large' | 'transparent' | 'compact'"'standard'"Visual layout. 'centered' centers the title between leading/actions (iOS-style). 'large' renders an iOS-style large title that collapses on scroll. 'transparent' removes background and border. 'compact' is a slim toolbar.
position'top' | 'sticky' | 'fixed' | 'static'"'static'"Page positioning of the bar.
position'top' | 'sticky' | 'fixed' | 'static'"'static'"Page positioning of the bar.
borderedboolean"true"Show a thin border under the bar.
borderedboolean"true"Show a thin border under the bar.
elevatedboolean"false"Replace the bottom border with a soft drop shadow.
elevatedboolean"false"Replace the bottom border with a soft drop shadow.
safeAreaboolean"false"Apply env(safe-area-inset-*) padding so the bar respects iOS notches and home indicator.
safeAreaboolean"false"Apply env(safe-area-inset-*) padding so the bar respects iOS notches and home indicator.
collapseOnScrollboolean"false"When variant='large', shrink the large title into the inline row as the page scrolls.
collapseOnScrollboolean"false"When variant='large', shrink the large title into the inline row as the page scrolls.
scrollContainerHTMLElement | nullScrollable element to observe for collapseOnScroll. Defaults to window.
scrollContainerHTMLElement | nullScrollable element to observe for collapseOnScroll. Defaults to window.
childrenReactNodeOptional extra row rendered below the toolbar (e.g., a search input, segmented control, tabs).
childrenReactNodeOptional extra row rendered below the toolbar (e.g., a search input, segmented control, tabs).
classNamestringAdditional CSS class for the bar root.
classNamestringAdditional CSS class for the bar root.
ariaLabelstringAccessible name applied to the landmark <header>.
ariaLabelstringAccessible name applied to the landmark <header>.
Features
Five variants
standard, centered, large (iOS-style), compact, and transparent.
Back button + actions
Built-in back button + an actions slot for icon buttons or menus.
Large-title collapse
When variant="large" + collapseOnScroll, the title shrinks to the inline row as the page scrolls.
Optional extra row
Pass children to add a second row for search inputs, filters, or segmented controls.
Safe-area-aware
safeArea prop applies env(safe-area-inset-top/left/right) so the bar respects iOS notches.
Position modes
static, sticky, fixed — pick the right scroll behavior for the screen.