Skip to content

Navigation Bar

Get Ritla UI

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

Open in Figma

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add navigation-bar

    Also works with shadcn: npx shadcn@latest add @ritla/navigation-bar

  2. Dependencies it brings

    @phosphor-icons/react

  3. Or 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

navigation-bar.tsx
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.

EnglishMirroredArabic
LTR →

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.

EnglishMirroredArabic
LTR →

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.

EnglishMirroredArabic
LTR →

API reference

NavigationBar

PropTypeDefaultDescription
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.
showLabelsbooleantrueFigma's Show label for the whole bar: every label or none.
aria-labelstringNoneThe landmark's name. Default: "Main" in the page language.

NavigationBarItem

PropTypeDefaultDescription
childrenReactNodeNoneFigma's Label: one short word.
iconIconComponentNoneFigma's Outline icon; drawn in the Fill weight when selected.
selectedIconIconComponentNoneFigma's Filled icon, when it isn't the same icon in the Fill weight.
selectedbooleanfalseFigma's Selected: the page you're on.
href / renderstring / ReactElementNoneThe destination, or a router link with the item's look.
badgenumber | trueNoneFigma's Badge: a count (Number) or true for a Dot.
badgeLabelReactNodeNoneWhat 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 toUseWhy
Switch between 3 to 5 main places on a phoneNavigation barAlways visible, within thumb reach.
The same on a tablet, up to 6 placesNavigation bar / TabletIcon beside the label, centred in the bar.
Navigate a desktop appSide navigation or Header navigationMore room, more items, nested sections.
Switch views inside one screenTabs or Toggle groupThey change the content here, not the place.
Start an action: create, scan, sendFAB or a ButtonActions 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: Icons with labelsOne word each; the filled icon marks where you are.
Don't: Icons aloneIs the card icon Cards or Payments? Without labels, people guess.

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.

Do: RTL variantHome is on the right, where the Arabic reader starts, and the order runs right to left.
Don't: English bar on an Arabic screenHome sits on the far left, the last place an Arabic reader looks.

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.

KeyAction
TabThrough the destinations in reading order.

ARIA

  • A nav named "Main" in the page language, a ul, and aria-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.

  • R042Clipped text: content wider than its box with overflow hidden and no ellipsis
  • R043Fixed-pixel-width container whose Arabic text exceeds the space
  • R050Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
  • R051letter-spacing applied to Arabic text (breaks the connected script)