Skip to content
Alea0.1

Navigation

BottomNavigation

The tab bar of a mobile app: three to five destinations with icons, labels and badges.

Ant Design: TabBar (antd-mobile)

import { BottomNavigation } from '@alea/ui';

Examples

Mobile tab bar

Shown inline here; it sticks to the bottom of the screen by default.

home

Props

BottomNavigation props

The tab bar of a mobile app: three to five destinations with icons and labels (MUI BottomNavigation, Ant Mobile TabBar).

PropTypeDefaultDescription
itemsrequired{ id: string; label: string; icon: ReactNode; href?: string | undefined; badge?: number | undefined; }[]-Three to five destinations: id, label, icon, and an href (links) or none (buttons with onChange).
valuerequiredstring-The current destination.
aria-labelstring-Name of the navigation. Default "Main".
classNamestring-Extra class names for the root element.
fixedbooleantrueStick to the bottom of the screen. Default true.
onChange((id: string) => void)-Called with the id of the destination picked.

Accessibility

  • A nav landmark of links or buttons; the current one has aria-current and badges are read as "3 new".

Keyboard

KeyDoes
TabMoves between destinations
EnterGoes to the destination

Do and don't

Do

  • Keep labels visible: icons alone are guesswork.

Don't

  • Don't use more than five items.
Tested with axe, keyboard and screen reader roles