Prodular UI

Tabs

Switches between views of the same content. A segmented control for short sets and a line variant for page sections.

npx prodular-ui add tabs

Segmented

The default. A muted track with the active tab raised on a card surface.

Requests
7.62M
Error rate
0.34%
p95 latency
236 ms

Line

A 2px primary indicator on a hairline. Use it for sections of a page.

18 people in Halden Analytics. 4 admins, 14 members.

Vertical

For settings pages with more than five sections.

Profile

Name, avatar and the email people see on comments.

Anatomy

<Tabs defaultValue="members">  <TabsList variant="line">    <TabsTrigger value="members">Members</TabsTrigger>    <TabsTrigger value="invites">Invites</TabsTrigger>  </TabsList>  <TabsContent value="members">...</TabsContent>  <TabsContent value="invites">...</TabsContent></Tabs>

Guidance

Use it when

  • Segmented (default) for two to four short options that filter one view: time ranges, chart modes.
  • Line for sections of a page or a panel: Members, Invites, Roles.
  • Vertical line tabs for settings with many sections.

Avoid

  • Tabs for steps in a sequence. Use a stepper or a multi step form.
  • More than six tabs in one row. Group them or use a vertical list.
  • Segmented tabs with long labels or icons only.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Give every TabsTrigger a value that matches one TabsContent, and set defaultValue on Tabs.
  • Use variant="line" on TabsList for page level navigation, the default variant for in-card filters.
  • Mark icons inside triggers with data-icon="inline-start".
  • Put counts in a Badge size="sm" variant="secondary" inside the trigger, after the label.
  • Pass orientation="vertical" on Tabs, not on TabsList.
  • Keep labels to one or two words in sentence case.
  • Use width="fit" for content-width tabs and size="sm" in dense panels instead of overriding flex-1 and heights on TabsTrigger.

API

Tabs

PropTypeDefaultDescription
defaultValuestringThe tab that is open on first render.
orientation"horizontal" | "vertical""horizontal"Lays the list out in a row or a column.

TabsList

PropTypeDefaultDescription
variant"default" | "line""default"Segmented track or line with an indicator.
width"fill" | "fit""fill"fill stretches segmented tabs across the list; fit sizes each tab to its label.
size"default" | "sm""default"sm for toolbars, inspectors and dense panels.

TabsTrigger

PropTypeDefaultDescription
valuestringIdentifies the tab. Required.
disabledbooleanfalseShows the tab but blocks selection.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add tabs# or, with the registry in components.jsonnpx shadcn@latest add @prodular/tabs