Tabs

Navigation

Panels shown one at a time, chosen with tabs: <Tabs.Root> (bind:value, orientation) holds a Tabs.List of Tabs.Triggers and a Tabs.Content per tab, matched by value. Arrow keys move between tabs and show their panel; Tab moves into the panel.

import { Tabs } from '@limerdev/zest';
Tabs for AI tools (llms.txt)
Use for
Views of the same thing side by side on one page: a project's overview, hours and settings; a form split into a few sections.
Don't
Moving between pages: use links (a NavigationMenu or a sidebar). Steps the user must go through in order. Many tabs that don't fit: use a Select or a sidebar.

Examples

Basic

Views of one project. Arrow keys move between tabs.

Twelve people on three projects. Next invoice on 15 December.

Vertical

orientation="vertical" stacks the tabs beside the panels; Up and Down move.

Name, timezone and language.

The tabs keep their own height, however tall the panel beside them grows.

Each setting is saved as soon as it changes.

Props

Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that renders your own element, with props to spread on it).

Tabs.Root

Prop Type Default Description
activationMode "manual" | "automatic" "automatic" How the tabs should be activated. If set to 'automatic', the tabs will be activated when the trigger is focused. If set to 'manual', the tabs will be activated when the trigger is pressed.
disabled boolean false Whether the tabs are disabled or not.
loop boolean false Whether to loop through the tabs when reaching the end when using the keyboard.
onValueChange OnChangeFn<string> โ€“ A callback function called when the selected tab changes.
orientation "horizontal" | "vertical" "horizontal" The orientation of the tabs.
value bindable string '' The value of the selected tab.

Tabs.List

No props of its own beyond the common ones.

Tabs.Trigger

Prop Type Default Description
disabled null | false | true false Whether the trigger is disabled or not.
value required string โ€“ The value of the tab associated with this trigger.

Tabs.Content

Prop Type Default Description
value required string โ€“ The value of the tab associated with this content.