Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-tab-bar.json --yes

Tab bar

Pro

A phone screen's bottom navigation, for React and Tailwind CSS. Part of Goop Pro.

Press a destination at the screen’s foot (or Tab onto one and press Enter or Space): the bar marks it and the screen shows its page. Opening Inbox reads its 3 new notes, so its count goes; pressing the current one again says it is already open. The line under the screen says what the last press did, and counts every press. The destinations and their pages are our own and live in this page alone: nothing is opened or read anywhere.

When to use

  • A phone screen's bottom navigation.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Tab bar on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-tab-bar.json --yes
PROMPT
Add the Goop Tab bar to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { TabBar, TabBarItem } from '@/components/ui/goop/tab-bar';
import { useState } from 'react';

function PhoneNav() {
  const [section, setSection] = useState('today');
  return (
    <TabBar value={section} onValueChange={setSection} className="narrow:hidden">
      <TabBarItem value="today" icon="calendar" asChild>
        <RouterLink href="/today">Today</RouterLink>
      </TabBarItem>
      <TabBarItem value="inbox" icon="inbox" href="/inbox" count={3}>
        Inbox
      </TabBarItem>
      <TabBarItem value="settings" icon="settings" onSelect={openSettings}>
        Settings
      </TabBarItem>
      <TabBarItem value="profile" icon="user" href="/profile">
        Profile
      </TabBarItem>
    </TabBar>
  );
}
  • Fits: frame (its recipe); frame: phone-nav (places: few).
  • Also known as: BottomNavigation, BottomNav, BottomTabs.
  • height, width, padding, gap, corner, border, background, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
value?stringThe current destination's value, held by you; give onValueChange with it.
defaultValue?stringThe destination current at first, when the bar holds it.
onValueChange?(value: string) => voidCalled with a destination's value when a press, a tap, Enter or Space selects another one.
position?'sticky' | 'fixed' | 'static' = 'sticky'sticky (the default) stands at the foot of what scrolls — the page, or a column it ends — and takes its own room; fixed stands over the window's foot (leave the page that room); static stays where it is written.
Defaultsaria-label = 'Main'
  • State: value (value / defaultValue / onValueChange)
Parts
PartWhat it is
TabBarItemOne destination of a TabBar; takes asChild; value: string — The destination's name for the bar's value; icon: IconName — The pack icon over the word, by its name; children: ReactNode — The short word under the icon (with asChild, your element, its children the word); href?: string — Where it goes; left out (and no asChild), the destination is a button that runs onSelect; onSelect?: () => void — Runs on every press, Enter or Space, the current destination's too (scroll its page to the top, open a search); onClick?: MouseEventHandler<HTMLAnchorElement | HTMLButtonElement> — Your press handler, before the bar's; event.preventDefault() keeps the current destination; count?: number — How many are new there, drawn as a disc at the icon's top end (9+ past 9); none at 0 or left out; countLabel?: (count: number) => string — The words a screen reader hears for the count after the name ((n) => \${n} unread\); the number by default
  • data-slot values (to select a part by): tab-bar, tab-bar-item, tab-bar-item-badge, tab-bar-item-control, tab-bar-item-icon, tab-bar-item-label, tab-bar-list

Keyboard

KeyWhat it does
TabMove to the next destination (each destination is one tab stop), then out of the bar
EnterGo to the focused destination: it becomes the current one
SpaceGo to the focused destination, as Enter (on a link too)

Accessibility

  • The native element answers the keyboard.
  • hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
currentthe attribute aria-current=page

Motion

  • The part sets its own motion: add no transition or animation of your own.
  • How the theme moves, and how to move your own parts the same way: Motion.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/tab-bar.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-tab-bar.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.