Tabs

Splits content into named panels and shows one at a time, as a row of tabs or a list whose rows can each carry a sentence.

Configurations

Supported configurations for this component.

States

Interaction states covered by the API and the style contract.

Configurations

3 examples
Horizontal
sm
md
lg
Vertical
sm
md
lg
Vertical, index and description
sm
md
lg

States

2 examples
Hover
Rest
Hover
Focus visible
Rest
Focus visible

Add to your project

One command adds this component to your project.

1

Run the following command. New project? Run npx shadcn@latest init first to set up Tailwind and path aliases.

npx shadcn@latest add @aicanvas/••••••••••••

Light and dark both come with the install and follow the dark class on <html>, the shadcn dark mode setup (next-themes with attribute="class").

Props

Every prop this component accepts. Any other prop is forwarded to the underlying element.

Tabs

PropTypeDefaultDescription
valuestring-Controlled selected value; pair with `onValueChange`.
defaultValuestring-Initial value when uncontrolled.
onValueChange(value: string) => void-Called with the value of the tab picked.
orientation'horizontal'|'vertical''horizontal'Horizontal: a row on the control ladder with the accent edge along the bottom. Vertical: a list of rows with hairlines between, the accent edge on the left, and room for a description per row.
size'sm'|'md'|'lg''md'Horizontal only: the rung on the shared control ladder (28, 32 or 40px tall; 12, 14 or 16px type), so a tab row sits level with the Buttons beside it.

TabsList

PropTypeDefaultDescription
aria-labelreqstring-Names the list for assistive tech (or use aria-labelledby).

TabsTrigger

PropTypeDefaultDescription
valuereqstring-The value this tab selects.
childrenreqReact.ReactNode-The tab's label.
leadingReact.ReactNode-A short mark before the label: an index ("01") or an icon. Faint at rest, primary when hovered or picked.
descriptionReact.ReactNode-Vertical only: a sentence under the label, muted at rest, secondary when hovered or picked.
disabledboolean-When true, disables the control.

TabsContent

PropTypeDefaultDescription
valuereqstring-The value whose panel this is. Only the selected value's panel is mounted.

More Andromeda Pro components