Tabs
Tabs organize related content into separate panels that share the same space, letting users switch between views without leaving the page. Reach for it when a section has a few peer views (settings groups, dashboards, detail panels) that are mutually exclusive. Keyboard support and roving focus come from the primitive underneath. Anatomy: Tabs (root, owns the selected value) wraps a TabsList of TabsTrigger buttons and one TabsContent panel per trigger, matched by their shared value.
Panels
value ties a trigger to its panel. The list is a field, not a card — the same well an Input sits in — so the active tab steps off the track it lives in and takes bg-selected, the treatment every chosen thing in the system wears.
Store name, contact address and default currency.
Which processor takes the money, and when it settles.
Zones, rates and the carriers behind them.
<Tabs value="general" class="w-full max-w-xl">
<TabsList>
<TabsTrigger value="general">General</TabsTrigger>
<TabsTrigger value="payments">Payments</TabsTrigger>
<TabsTrigger value="shipping">Shipping</TabsTrigger>
</TabsList>
<TabsContent value="general">
<p class="text-muted text-sm">Store name, contact address and default currency.</p>
</TabsContent>
<TabsContent value="payments">
<p class="text-muted text-sm">
Which processor takes the money, and when it settles.
</p>
</TabsContent>
<TabsContent value="shipping">
<p class="text-muted text-sm">Zones, rates and the carriers behind them.</p>
</TabsContent>
</Tabs>Disabled trigger
A disabled trigger is skipped by arrow-key navigation rather than focused and refused. Reach for it only where the panel genuinely cannot be reached yet.
Payout opens once the first order settles.
<Tabs value="details" class="w-full max-w-xl">
<TabsList>
<TabsTrigger value="details">Details</TabsTrigger>
<TabsTrigger value="payout" disabled>Payout</TabsTrigger>
</TabsList>
<TabsContent value="details">
<p class="text-muted text-sm">Payout opens once the first order settles.</p>
</TabsContent>
</Tabs>Manual activation
activationMode="manual" waits for Enter or Space instead of switching on focus. Use it when a panel costs something to open — a fetch, a chart, a form that resets — so arrowing past it does not fire that off four times.
Each report is fetched only once its tab is activated.
Weekly rollup.
Monthly rollup.
<Tabs value="daily" activationMode="manual" class="w-full max-w-xl">
<TabsList>
<TabsTrigger value="daily">Daily</TabsTrigger>
<TabsTrigger value="weekly">Weekly</TabsTrigger>
<TabsTrigger value="monthly">Monthly</TabsTrigger>
</TabsList>
<TabsContent value="daily">
<p class="text-muted text-sm">
Each report is fetched only once its tab is activated.
</p>
</TabsContent>
<TabsContent value="weekly">
<p class="text-muted text-sm">Weekly rollup.</p>
</TabsContent>
<TabsContent value="monthly">
<p class="text-muted text-sm">Monthly rollup.</p>
</TabsContent>
</Tabs>API
Tabs
Tabs organize related content into separate panels that share the same space, letting users switch between views without leaving the page. Reach for it when a section has a few peer views (settings groups, dashboards, detail panels) that are mutually exclusive. Keyboard support and roving focus come from the primitive underneath. Anatomy: Tabs (root, owns the selected value) wraps a TabsList of TabsTrigger buttons and one TabsContent panel per trigger, matched by their shared value.
| Prop | Type | Default | Description |
|---|---|---|---|
children required | import('svelte').Snippet | The | |
value bindable | string | The | |
class | string | Extra Tailwind classes merged onto the root element (a vertical flex column with gap by default). | |
orientation | 'horizontal'|'vertical' | Layout and arrow-key navigation direction of the tab list (forwarded via | |
activationMode | 'automatic'|'manual' |
| |
loop | boolean | When true, arrow-key focus wraps from the last trigger back to the first (forwarded via | |
disabled | boolean | Disables the whole tab set (forwarded via |
TabsList
Container that groups the TabsTrigger buttons of a Tabs root into the pill-shaped bar used to switch between panels.
| Prop | Type | Default | Description |
|---|---|---|---|
children required | import('svelte').Snippet | The | |
class | string | Additional Tailwind classes merged onto the list container. |
TabsTrigger
A single clickable tab within a TabsList. Its value must match the value of the TabsContent panel it controls.
| Prop | Type | Default | Description |
|---|---|---|---|
children required | import('svelte').Snippet | Trigger label/content. | |
value required | string | Identifies which | |
class | string | Additional Tailwind classes merged onto the trigger. | |
disabled | boolean | Disables this trigger (forwarded via |
TabsContent
The panel shown when its value matches the active tab set on the Tabs root.
| Prop | Type | Default | Description |
|---|---|---|---|
children required | import('svelte').Snippet | Panel content. | |
value required | string | Matches the | |
class | string | Additional Tailwind classes merged onto the panel. |