Components
BottomBar
The phone navigation bar, with up to 5 items and an optional More item for the rest.
Overview
BottomBar is the main navigation on phones, usually alongside a Sidebar on larger screens. It takes up to 5 BottomBarItems and, with onMore, adds a trailing "More" item that opens whatever you anchor to it (a menu or a sheet).
The bar pads itself clear of the home indicator, and every item has at least a 48 px target.
Import
import { BottomBar, BottomBarItem } from '@unflowio/ui/components/BottomBar';Props
BottomBar
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Up to 5 BottomBarItems |
onMore | (anchor: HTMLButtonElement) => void | — | Shows a trailing "More" item; receives the item so a menu or sheet can anchor to it |
moreActive | boolean | — | Marks "More" as current, e.g. while its sheet is open or one of its pages is shown |
linkComponent | ElementType | 'a' | Renders item links, e.g. next/link |
BottomBarItem
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Required. Item text |
icon | IconName | ReactNode | — | An icon name rendered with Icon, or any node |
href | string | — | Renders a link. Without it the item is a button |
onClick | MouseEventHandler<HTMLElement> | — | Click handler |
active | boolean | — | Marks the current page |
count | number | — | Counter badge on the icon |
disabled | boolean | — | Disables the item |
linkComponent | ElementType | — | Overrides the bar's linkComponent for this item |
Basic usage
<BottomBar>
<BottomBarItem icon="house" label="Home" href="/" active />
<BottomBarItem icon="folder" label="Projects" href="/projects" />
<BottomBarItem icon="books" label="Library" href="/library" />
<BottomBarItem icon="bell" label="Inbox" href="/inbox" count={12} />
</BottomBar>More
More is closed
<BottomBar onMore={(anchor) => openMoreSheet(anchor)} moreActive={moreSheetOpen}>
…
</BottomBar>Accessibility
- The bar is a
<nav>landmark named "Main" (translated), and "More" has a translated label. - The active item has
aria-current="page". An item with a count includes it in its accessible name.