Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-top-bar

Top bar

Free

The bar across the top of a page in the app frame, with its title, tabs and actions, for React and Tailwind CSS. Free, MIT.

Press the sidebar toggle, the worded action, the icon action or a view tab; switch the action’s look, add the tabs’ row, make the title long; pick the list’s bar or the bar whose title opens a menu; narrow the window to a phone. Nothing opens: each press is only written under the bar.

When to use

  • The bar across the top of a page in the app frame, with its title, tabs and actions.
  • Also called: header or navbar.

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 Top bar on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing.

Terminal
npx shadcn@4.23.1 add @goop/trail-top-bar
PROMPT
Add the Goop Top bar to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { TopBar, TopBarRow, TopBarGroup, TopBarTitle, TopBarTitleMenu, TopBarToggle, TopBarButton, TopBarAction, TopBarTabs } from '@/components/ui/goop/top-bar';
import { ButtonIcon } from '@/components/ui/goop/button';

<TopBar>
  <TopBarRow>
    <TopBarGroup>
      <TopBarTitle>Inbox</TopBarTitle>
    </TopBarGroup>
    <TopBarGroup align="end">
      <TopBarButton>
        <ButtonIcon icon="plus" />
        New note
      </TopBarButton>
      <TopBarAction icon="adjustments-horizontal" aria-label="Display options" />
    </TopBarGroup>
  </TopBarRow>
</TopBar>
  • Fits: frame (its recipe).
  • height, width, padding, gap, border, background, text, motion: add no class for these.

API reference

Parts
PartWhat it is
TopBarRowOne row of the bar
TopBarGroupA group of a row; align?: 'start' | 'end' = 'start' — start (the default): the growing group at the row's start; end: the group of controls at its end
TopBarTitleThe page's name; takes asChild
TopBarTitleMenuThe page's name as a button that opens its menu, inside a heading; headingLevel?: 1 | 2 | 3 | 4 | 5 | 6 = 2 — The heading's level: 2 (the default) as TopBarTitle's; also takes type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; aria-label?: string
TopBarToggleA 28 px toggle in the bar, an icon alone named with aria-label, or an icon with words; also takes pressed?: boolean; defaultPressed?: boolean; onPressedChange?: (pressed: boolean) => void; disabled?: boolean
TopBarButtonThe bar's quiet worded action, a 28 px ghost pill button holding a ButtonIcon and words; also takes type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; loading?: boolean = false; loadingLabel?: string = 'Loading'
TopBarActionAn icon-only control in the bar, ringed (the default) or quiet; name it with aria-label; variant?: 'outline' | 'ghost' = 'outline' — outline (the default) the white ringed button at the row's end, ghost the quiet one with no fill; icon?: IconName — A pack icon name (an outline icon, or a filled one), drawn by the button itself; children?: ReactNode — The button's own IconButtonIcon (or, with asChild, the one element it becomes), in place of icon; one of the two is required; also takes type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; aria-label: string; tooltip?: string | false; tooltipKeys?: readonly string[]; loading?: boolean = false; loadingLabel?: string = 'Loading'
TopBarTabsThe bar's view pills, a tab list inside the caller's Tabs holding TabsTriggers; name it with aria-label; also takes action?: ReactNode; size?: 'sm' | 'md' = 'md'
  • data-slot values (to select a part by): top-bar, top-bar-group, top-bar-row, top-bar-title, top-bar-title-menu

Accessibility

  • hover, active: the browser's own (:hover, :active): write nothing

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

StateDrawn by
pressedthe attribute aria-pressed
expandedthe attribute data-state=open
openthe attribute data-state=open
disabledthe prop disabled

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/top-bar.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-top-bar

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.