Navigation Bar
Quick access to 3 to 5 top-level destinations at the bottom of a phone screen (up to 6 on tablets), each with an icon and a short label.
Ritla scan of this preview: 41 of 41 checks3 breakpointsScanned
Preview
Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.
Installation
Add the component
npx ritla add navigation-barAlso works with shadcn:
npx shadcn@latest add @ritla/navigation-barDependencies it brings
@phosphor-icons/reactOr copy by hand
Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.
Usage
import { NavigationBar, NavigationBarItem } from "@/components/ui/navigation-bar";<NavigationBar className="fixed inset-x-space-0 bottom-space-0"> <NavigationBarItem href="/" icon={HouseIcon} selected>Home</NavigationBarItem> <NavigationBarItem href="/alerts" icon={BellIcon} badge={3} badgeLabel="new alerts">Alerts</NavigationBarItem></NavigationBar>Examples
Tablet
layout="tablet": up to six destinations, the icon beside the label, a dot badge.
Auto layout and router links
The default layout="auto": the phone bar below md, the tablet bar from md. Items are <Link>s through render, and showLabels={false} hides the labels across the bar while screen readers keep them.
Floating
variant="floating" and "floating-inverse": a pill bar of icons, only the selected item showing its label. Three to five destinations (Figma draws five). The page places it, e.g. fixed inset-x-space-0 bottom-space-16 mx-auto.
API reference
NavigationBar
| Prop | Type | Default | Description |
|---|---|---|---|
layout | "auto" | "phone" | "tablet" | "auto" | The phone bar, the tablet bar, or both by screen width. Standard only. |
variant | "standard" | "floating" | "floating-inverse" | "standard" | Figma's Style: the full-width bar or the floating pill. |
showLabels | boolean | true | Figma's Show label for the whole bar: every label or none. |
aria-label | string | None | The landmark's name. Default: "Main" in the page language. |
NavigationBarItem
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | None | Figma's Label: one short word. |
icon | IconComponent | None | Figma's Outline icon; drawn in the Fill weight when selected. |
selectedIcon | IconComponent | None | Figma's Filled icon, when it isn't the same icon in the Fill weight. |
selected | boolean | false | Figma's Selected: the page you're on. |
href / render | string / ReactElement | None | The destination, or a router link with the item's look. |
badge | number | true | None | Figma's Badge: a count (Number) or true for a Dot. |
badgeLabel | ReactNode | None | What the badge means, for screen readers ("new alerts"). |
Usage guidelines
The navigation bar holds the top-level destinations of a phone app. When it fits, how to write its items and badges, how it starts from the right in Arabic, and the checks before handoff.
1. When it fits
Use the navigation bar on phones for three to five top-level destinations people switch between often. On tablets, the Tablet version holds up to six. On desktop, the same destinations move to Side navigation or Header navigation. Actions are not destinations: Create or Scan belong in a FAB or the page.
| You need to | Use | Why |
|---|---|---|
| Switch between 3 to 5 main places on a phone | Navigation bar | Always visible, within thumb reach. |
| The same on a tablet, up to 6 places | Navigation bar / Tablet | Icon beside the label, centred in the bar. |
| Navigate a desktop app | Side navigation or Header navigation | More room, more items, nested sections. |
| Switch views inside one screen | Tabs or Toggle group | They change the content here, not the place. |
| Start an action: create, scan, send | FAB or a Button | Actions aren't places people stay. |
2. Items and labels
Each item has an icon and a one-word label, and every item shows its label. Order items by importance, most used first at the inline start. The selected item switches to its filled icon and the brand pill. Keep the same items, in the same order, on every top-level screen.
Every item labeled
The main navigation of a banking app.
Do
- Label every item with one short word: Home, Transfers, Cards, Profile.
- Use the filled icon for the selected item, the outline icon for the rest.
- Put the most used destination first.
- Keep items and order identical on every screen that shows the bar.
Don't
- Hide labels on some items and show them on others.
- Use two-line or long labels.
- Change the items depending on the screen.
- Use the bar for actions like Create or Share.
3. Badges
A Dot says something is new; a Number says how many. Use them only for things that need attention in that destination, and clear them when people visit. Cap numbers so they stay short (99+).
Do
- Use a Dot for something new, a Number for a count that matters.
- Clear the badge when people open the destination.
- Give badges text for screen readers: “Transfers, 3 pending”.
Don't
- Badge every item at once.
- Use badges for marketing (“New!”) that never clears.
- Show long numbers like 1,284.
4. Arabic and RTL
The RTL variant starts from the right: the first item, usually Home, sits on the right edge, where the Arabic reader starts. The order doesn't change, only its direction. Icons keep their shape unless they are directional. Arabic labels stay short, one word where possible.
The bar starts from the right
The same app in Arabic.
5. Behavior between screens
The bar stays on every top-level screen and usually hides on detail screens and full-screen flows (checkout, camera). Each destination remembers where people were. Pressing the selected item again returns to its top.
Do
- Keep the bar on top-level screens.
- Hide it in focused flows and restore it after.
- Remember each destination's place and scroll position.
- Pressing the selected item scrolls to its top.
Don't
- Reset a destination every time people switch.
- Hide the bar on scroll on top-level screens.
Before handoff
- 3 to 5 destinations on phones, up to 6 on tablets.
- Every item has a one-word label and outline and filled icons.
- Badge rules are noted.
- Arabic screens use the RTL variant, starting from the right.
Accessibility
Keyboard
Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.
| Key | Action |
|---|---|
| Tab | Through the destinations in reading order. |
ARIA
- A
navnamed "Main" in the page language, aul, andaria-current="page"on the selected item. - Every item is 64px tall, above the 48px touch target.
- Badges are read with their meaning: "3 new alerts"; a dot without a label reads "New".
Do
- Mark the bar as navigation, and the selected item with
aria-current="page". - 48 px targets.
- Name items by their labels.
Don't
- Color alone for the selected item; the filled icon and the pill carry it too.
- Announce badges as a bare number with no context.
Arabic and RTL notes
Mirrors
- The first destination sits on the right; on tablets the icon sits to the right of the label.
Does not mirror
- Icons, except directional ones (the mirror list).
- Numerals
- Badge counts follow the numerals setting.
- Arabic typography
label-12: Regular, Medium when selected.- Mixed-direction text
- Keep labels to one word; longer ones crowd the phone bar.
Do
- The RTL variant, with the first item on the right.
- The same order as English, running right to left.
- Short native labels: «حسابي» for Profile.
Don't
- The English bar on an Arabic screen, with Home on the left.
- Reverse the order by hand in the English variant.
- Mirror non-directional icons: a house, a card.
Checks it passes
The Ritla checks this component satisfies by construction. Used as documented, it does not bring these defects onto your page.
- Clipped text: content wider than its box with overflow hidden and no ellipsis
- Fixed-pixel-width container whose Arabic text exceeds the space
- Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
- letter-spacing applied to Arabic text (breaks the connected script)