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

Tabs

Free

A row of tabs that switch between panels of content in one place, such as a record's overview and activity, 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 that switch between panels of content in one place, such as a record's overview and activity.
  • 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/trail-tabs
PROMPT
Add the Goop Tabs to this project. The install steps are at https://goop.so/docs/install.md

Usage

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

<Tabs defaultValue="all">
  <TabsList>
    <TabsTrigger value="all" count={12} countLabel={(n) => `${n} open`}>
      All
    </TabsTrigger>
    <TabsTrigger value="mine" count={3} countLabel={(n) => `${n} open`}>
      Mine
    </TabsTrigger>
  </TabsList>
  <TabsContent value="all">…</TabsContent>
</Tabs>
  • Fits: record (its recipe).
  • Queue tabs with counts above a list: give each TabsTrigger its count and a countLabel for a screen reader (count={12} countLabel={(n) => \${n} open\} reads "Orders, 12 open"); a zero is drawn.
  • height, width, padding, gap, corner, border, background, shadow, text, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
value?string
defaultValue?string
onValueChange?(value: string) => void
  • State: value (value / defaultValue / onValueChange); drawn by data-state=open
Parts
PartWhat it is
TabsListThe row of tabs; variant: default (default), ghost, segmented, outline; action?: ReactNode — A control after the tabs, outside the tablist (a TabsAction); none by default; size?: 'sm' | 'md' = 'md' — The quiet and outlined rows' tab sides (the view pills and the segments keep theirs): md (the default) 12 px, sm 4 px for a tight row such as five presets in a 268 px layer; the tabs keep their height and touch size
TabsTriggerOne tab in the TabsList; its value names the TabsContent it shows; count?: number — How many the tab's view holds ("Orders 12"), drawn after its words as a quiet number; 0 is drawn (an empty queue 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; also takes value: string; disabled?: boolean
TabsActionA trailing control of the row (a new view, a view's options); icon: IconName — A pack icon name (an outline or a filled one); 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; also takes value: string
  • Class recipes (cva): tabsListVariants (TabsList)
  • data-slot values (to select a part by): tabs, tabs-content, tabs-edge, tabs-hover, tabs-indicator, tabs-list, tabs-list-inner, tabs-trigger, tabs-trigger-count, tabs-trigger-label

Accessibility

  • The behaviour layer under the part answers keys, focus and dismissal: never write your own.
  • 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:

StateDrawn by
selectedthe attribute aria-selected
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/tabs.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add @goop/trail-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.