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

Tabs

Free

A row of tabs over the panels they show, one panel at a time, for React and Tailwind CSS. Free, MIT.

Switch views with a click or the arrow keys (Home and End too): the indicator moves and the panel changes. Change the row’s variant, or leave the panels out. The tasks are words of our own.

When to use

  • A row of tabs over the panels they show, one panel at a time.
  • Also called: tab bar.

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 Tabs 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-tabs
PROMPT
Add the Goop Tabs to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { Tabs, TabsAction, TabsContent, TabsList, TabsTrigger } from '@/components/ui/goop/tabs';

function SiteVisitTabs() {
  return (
    <Tabs defaultValue="overview">
      <TabsList aria-label="Site visit" action={<TabsAction icon="plus" aria-label="New view" />}>
        <TabsTrigger value="notes" count={21}>
          Field notes
        </TabsTrigger>
        <TabsTrigger value="overview">Overview</TabsTrigger>
        <TabsTrigger value="tasks" count={3} countLabel={(n) => `${n} open`}>
          Tasks
        </TabsTrigger>
        <TabsTrigger value="photos" disabled>
          Photos
        </TabsTrigger>
      </TabsList>
      <TabsContent value="notes" className="py-3 text-sm">
        Soil samples from the north field
      </TabsContent>
      <TabsContent value="overview" className="py-3 text-sm">
        Drainage looks sound; the culvert needs clearing.
      </TabsContent>
      <TabsContent value="tasks" className="py-3 text-sm">
        Book the survey crew for Friday
      </TabsContent>
    </Tabs>
  );
}
  • height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
value?stringThe selected tab's value, held by the caller; with onValueChange.
defaultValue?stringThe tab selected at first, when the tabs hold it.
onValueChange?(value: string) => voidCalled with the value of the tab just selected.
  • State: value (value / defaultValue / onValueChange)
Parts
PartWhat it is
TabsListThe row of tabs, a tablist; name it with aria-label where no heading names it; variant?: 'default' | 'ghost' | 'segmented' | 'outline' = 'default' — The row's look: the underlined row (the default), quiet pills, joined framed pills or raised pills; size?: 'sm' | 'md' = 'md' — The quiet and raised pills' sides: md (the default) 10 px, sm 4 px; the tabs keep their height; action?: ReactNode — A control after the tabs, outside the tablist (a TabsAction); none by default
TabsTriggerOne tab in the TabsList; its value names the TabsContent it shows; value: string — The tab's name among its siblings: the value of the TabsContent it shows; disabled?: boolean — The tab cannot be selected, and the keyboard passes over it; count?: number — How many the tab's view holds ("Tasks 6"), drawn after its words as small grey figures; 0 is drawn (an empty view says so), and a tab with no count draws none; countLabel?: (count: number) => string — The words a screen reader hears for the count after the tab's name ((n) => \${n} open\); the number by default
TabsActionA trailing control of the row (a new view, a view's options), passed as the TabsList's action; 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'
TabsContentThe panel a tab shows, a tabpanel named by its tab; shown while its tab is selected, out of the page otherwise (forceMount keeps it in the page, hidden, for content that must keep its state); also takes value: string
  • Class recipes (cva): tabsListVariants
  • data-slot values (to select a part by): tabs, tabs-badge, tabs-content, tabs-indicator, tabs-label, tabs-list, tabs-row, tabs-trigger

Keyboard

KeyWhat it does
ArrowLeft ArrowRightMove selection
HomeMove selection
EndMove selection

Accessibility

  • The behaviour layer under the part answers keys, focus and dismissal: never write your own.
  • hover, active, focus, focus-visible, focus-within: the browser's own (:hover, :active, :focus, :focus-visible, :focus-within): write nothing

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

StateDrawn by
selectedthe attribute aria-selected
disabledthe prop disabled

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.

goop.so/themes/meadow/components/tabs.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/meadow-tabs

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.