# Tab bar

A mobile app’s bottom navigation, in place of the plain of three to five icon-and-label links fixed to the foot of the screen. The one you are on is marked by a single pill that slides along the tray, a pocket milled into the metal, and by the lit green in its icon and label. Press a tab and the pill answers at once; drag it and it follows your finger, then goes to the nearest tab. A count sits on an icon as a small printed cap and is spoken. It is markup, a stylesheet and a small script (wireTabBar) that makes and moves the pill; without the script the current link wears the pocket itself.

Kit part · With the Kit · https://tactileui.dev/parts/tab-bar

> The code and styling for this part come with the Tactile UI Kit, which the Pass and the Founder Pass include. Sign in if you have it. Sign in: https://tactileui.dev/auth/sign-in The price: https://tactileui.dev/pricing

## Anatomy

It is made of the kit’s own materials: a plate with a lit top face and a shaded foot, a real shadow cast on the content, the milled pocket of the kit’s wells, the raised key for the cap variant, the lamp’s green for the lit icon and label, and the kit’s own icons (the house is the kit’s home glyph, drawn from the IconMCP house, MIT). Tactile has no glass, so the tray floats by its thickness and its shadow, not by blur. The pill moves on a spring with no overshoot, and bounces slightly only after a flick; a tap in the middle of a slide sets out from where the pill is. Nothing has an outline: edges are lit and shaded, shapes are fills.

## Variants

- Default · the pill is a pocket milled into the tray
- The pill as a raised cap
- Search split off
- Quiet volume
- Three items
- Four items
- A count · 3 unread on Inbox

## States

- Not current
- Current

## Props and options

| Name | Kind | Description |
| - | - | - |
| wireTabBar(nav) | function | Makes the pill and wires press, drag and release. |

## Usage notes

Press a tab: the icon answers on the way down, and on release the pill slides to it and its icon and label light green. Drag the pill along the bar and let go: it goes to the tab nearest where it was heading. Tab through the bar with the keyboard: each link takes the kit’s focus ring. Inbox carries a count, “3 unread” to a screen reader.

## Accessibility

- It is a landmark of links. The pill is aria-hidden.
- Keyboard: Tab goes to each link in turn, Enter follows it. Dragging the pill is an extra for fingers; every tab is still a link.
- The chosen tab is not shown by colour alone: it sits in the pill, a shape, as well as being lit green.
- A count is printed and spoken: “Inbox 3 unread”. It is a cap with a number in it, and a dot with no number has hidden words of its own.
- If you switch views in place with buttons, use buttons with aria-pressed (or a real tablist) and keep to that one model. Links with aria-current are the default.
- Under reduced motion the pill does not slide. Without script the current link wears the pocket itself.

## Related parts

- [Icon rail](https://tactileui.dev/parts/icon-rail): An icon rail is a narrow sidebar of icon keys, using the kit’s own icons. A lamp beside the current one is lit, a label shows as a tooltip on hover and on focus, and a key at the foot opens the rail out so every label is printed beside its icon. It remembers which way you left it.
- [Tabs](https://tactileui.dev/parts/tabs): Views of the same thing, switched in place: keys in a tray, the chosen view a raised cap.
- [Bottom sheet](https://tactileui.dev/parts/bottom-sheet): A panel that rises from the bottom edge of the window, on the native dialog, for a short task that should not leave the page: add an expense, set some filters, pick an action. It stops at two heights, half and full. A grip in its top edge drags it, or steps it between the heights from the keyboard; dragged down from half it goes away. The key that saves stays in sight at half, and the content scrolls only when the sheet is full. On a phone it is the whole width; on a wide screen it is a card, centred, standing on the bottom edge.
