npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-toolbar.json --yesToolbar
ProA row of controls (a view's choice menus and its actions), for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
- ToolbarButtonIconThe control's glyph, as a part
- ToolbarButtonA control of the row
- ToolbarActionAn icon control of the row (a filter, a view's options)
import { ToolbarButtonIcon, ToolbarAction } from '@/components/ui/goop/toolbar';
import { useState } from 'react';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@/components/ui/goop/dropdown-menu';
import { Toolbar, ToolbarButton } from '@/components/ui/goop/toolbar';
const LANGUAGES = ['English (UK)', 'Spanish (MX)', 'French (FR)'];
function SummaryActions({ onCopy, onExport }: { onCopy: () => void; onExport: () => void }) {
const [language, setLanguage] = useState(LANGUAGES[0]);
return (
<Toolbar role="group" aria-label="Summary actions">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<ToolbarButton icon="languages">{language}</ToolbarButton>
</DropdownMenuTrigger>
<DropdownMenuContent>
{LANGUAGES.map((option) => (
<DropdownMenuItem key={option} onSelect={() => setLanguage(option)}>
{option}
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
<ToolbarButton icon="copy" onClick={onCopy}>
Copy summary
</ToolbarButton>
<ToolbarButton icon="download" onClick={onExport}>
Save a PDF
</ToolbarButton>
</Toolbar>
);
}Set the task’s status, priority, owner and due week from the toolbar’s menus; each change is written in the history under it, and the round action at the row’s end undoes the last one. Narrow the window and the row wraps. The task and its history live in the page only. The row is not an arrow-key toolbar: each control is its own Tab stop, as the theme draws it.
When to use
- A row of controls (a view's choice menus and its actions).
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 Toolbar 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.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-toolbar.json --yesAdd the Goop Toolbar to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { ToolbarButtonIcon, ToolbarAction } from '@/components/ui/goop/toolbar';
import { useState } from 'react';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@/components/ui/goop/dropdown-menu';
import { Toolbar, ToolbarButton } from '@/components/ui/goop/toolbar';
const LANGUAGES = ['English (UK)', 'Spanish (MX)', 'French (FR)'];
function SummaryActions({ onCopy, onExport }: { onCopy: () => void; onExport: () => void }) {
const [language, setLanguage] = useState(LANGUAGES[0]);
return (
<Toolbar role="group" aria-label="Summary actions">
<DropdownMenu>
<DropdownMenuTrigger asChild>
<ToolbarButton icon="languages">{language}</ToolbarButton>
</DropdownMenuTrigger>
<DropdownMenuContent>
{LANGUAGES.map((option) => (
<DropdownMenuItem key={option} onSelect={() => setLanguage(option)}>
{option}
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
<ToolbarButton icon="copy" onClick={onCopy}>
Copy summary
</ToolbarButton>
<ToolbarButton icon="download" onClick={onExport}>
Save a PDF
</ToolbarButton>
</Toolbar>
);
}- Fits: list, overview: toolbar.
- height, width, padding, gap, corner, background, text, motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| variant | default | wrap | footer = default |
| Part | What it is |
|---|---|
| ToolbarButtonIcon | The control's glyph, as a part; className?: string — Classes for the button's glyph, such as a mark's colour in light and dark; none by default; box?: { w: number; h: number } — The glyph's box in CSS px, { w, h }: 16 by 16 unless given (an owner's mark 14 by 14) |
| ToolbarButton | A control of the row; variant: default (default), value, owner; icon: IconName — A pack icon name; tooltip?: string | false — An icon alone's tooltip: left out, its aria-label shows on hover and keyboard focus; words to show other words; false for none; loading?: boolean = false — The control's action is running: the spinner in its icon's place, and no press reaches onClick; loadingLabel?: string = 'Loading' — What a reader hears beside the control's name while loading (default "Loading"); also takes type?: 'button' | 'submit' | 'reset'; onClick?: (event: MouseEvent) => void; disabled?: boolean |
| ToolbarAction | An icon control of the row (a filter, a view's options); icon: IconName — A pack icon name; 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' |
- Class recipes (cva): toolbarVariants (Toolbar), toolbarButtonVariants (ToolbarButton)
- data-slot values (to select a part by): toolbar, toolbar-button, toolbar-button-icon, toolbar-button-indicator
Keyboard
| Key | What it does |
|---|---|
| Enter | Activate |
| Space | Activate |
Accessibility
- The native element answers the keyboard.
- hover, active, focus-visible, focus-within: the browser's own (:hover, :active, :focus-visible, :focus-within): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| expanded | the attribute data-state=open |
| open | the attribute data-state=open |
Motion
- The part sets its own motion: add no transition or animation of your own.
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.