UnflowUI
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

PropTypeDefaultDescription
childrenReactNode—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
moreActiveboolean—Marks "More" as current, e.g. while its sheet is open or one of its pages is shown
linkComponentElementType'a'Renders item links, e.g. next/link

BottomBarItem

PropTypeDefaultDescription
labelstring—Required. Item text
iconIconName | ReactNode—An icon name rendered with Icon, or any node
hrefstring—Renders a link. Without it the item is a button
onClickMouseEventHandler<HTMLElement>—Click handler
activeboolean—Marks the current page
countnumber—Counter badge on the icon
disabledboolean—Disables the item
linkComponentElementType—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.