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

Top bar

Free

The bar across the top of a page, with its breadcrumbs and title at its start and its page-level controls at its end, 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, with its breadcrumbs and title at its start and its page-level controls at its end.
  • 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/meadow-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 { TopBarTitleMenu, TopBarToggle, TopBarTabs } from '@/components/ui/goop/top-bar';

import { useState } from 'react';
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/goop/toggle-group';
import {
  TopBar,
  TopBarAction,
  TopBarButton,
  TopBarCrumb,
  TopBarCrumbs,
  TopBarGroup,
  TopBarRow,
  TopBarTitle,
} from '@/components/ui/goop/top-bar';

function ScheduleBar({ onStep, onNew }: { onStep: (by: -1 | 1) => void; onNew: () => void }) {
  const [view, setView] = useState('week');
  return (
    <TopBar>
      <TopBarRow>
        <TopBarGroup>
          <TopBarCrumbs>
            <TopBarCrumb href="/schedule">Schedule</TopBarCrumb>
          </TopBarCrumbs>
          <TopBarTitle>Week of 16 Nov</TopBarTitle>
        </TopBarGroup>
        <TopBarGroup align="end">
          <TopBarAction icon="chevron-left" aria-label="Previous week" onClick={() => onStep(-1)} />
          <TopBarAction icon="chevron-right" aria-label="Next week" onClick={() => onStep(1)} />
          <ToggleGroup variant="outline" fit aria-label="Calendar view" value={view} onValueChange={setView}>
            <ToggleGroupItem value="day">Day</ToggleGroupItem>
            <ToggleGroupItem value="week">Week</ToggleGroupItem>
          </ToggleGroup>
          <TopBarButton variant="primary" onClick={onNew}>
            New event
          </TopBarButton>
        </TopBarGroup>
      </TopBarRow>
    </TopBar>
  );
}
  • Fits: account, frame, inbox, record, settings (their recipes).
  • height, width, padding, gap, corner, 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
TopBarCrumbsThe trail of places above the page, before its title
TopBarCrumbOne ancestor page in TopBarCrumbs; takes asChild; also takes href?: string
TopBarTitleThe page's name; takes asChild
TopBarTitleMenuThe page's name as a button that opens its menu, inside a heading; its props: top-bar--title-menu.md
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 worded action, the theme's 28 px Button; its props: top-bar--button.md
TopBarActionAn icon-only control in the bar (back, forward, a panel's toggle); name it with aria-label; its props: top-bar--action.md
TopBarTabsThe bar's row of views, a tab list inside the caller's Tabs holding TabsTriggers; name it with aria-label; also takes variant?: 'default' | 'ghost' | 'segmented' | 'outline' = 'default'; size?: 'sm' | 'md' = 'md'; action?: ReactNode

TopBarAction

An icon-only control in the bar (back, forward, a panel's toggle); name it with aria-label.

TSX
import { TopBarAction } from '@/components/ui/goop/top-bar';

Options

  • variant?: 'ghost' | 'outline' = 'ghost' — ghost (the default): the quiet button, no fill until the pointer's wash; outline (the other theme's value) the theme's outline icon button, the card fill inside a 1 px grey edge, for a standing control.
  • icon?: IconName — A pack icon name, 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'

TopBarButton

The bar's worded action, the theme's 28 px Button.

TSX
import { TopBarButton } from '@/components/ui/goop/top-bar';

Options

  • variant?: 'primary' | 'ghost' = 'ghost' — ghost (the default) a quiet action, primary the solid main action.
  • Also takes: type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean; loading?: boolean = false; loadingLabel?: string = 'Loading'

TopBarTitleMenu

The page's name as a button that opens its menu, inside a heading.

TSX
import { TopBarTitleMenu } from '@/components/ui/goop/top-bar';

Options

  • 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

Keyboard

KeyWhat it does
TabWalk the crumbs, the title's menu button and the bar's controls in order; the bar holds no stop of its own
Enter SpaceOn the title's menu button: open the page's menu; on a control: the control's own
EnterOn a crumb: go to that page

Accessibility

  • The part itself answers the keys above.
  • hover: the browser's own (:hover): write nothing

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

StateDrawn by
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.

Responsive behaviour

  • One bar per page, spanning its panel: TopBarCrumbs and a TopBarTitle (or a TopBarTitleMenu) in the start group, the controls in the end group (TopBarActions, a ToggleGroup with variant="outline" and fit as the segmented control, one TopBarButton variant="primary" for the main action, last). On a phone keep the title, the main action and at most two icon controls; leave the segmented control to a menu.

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