Layout
Tabs
Views of one thing, one at a time. Arrow keys move between the tabs.
Layout
Views of one thing, one at a time. Arrow keys move between the tabs.
Change the props on the right. The tabs and their code follow.
import { Tabs, TabsContent, TabsList, TabsTrigger } from 'omuk-ui/tabs';
<Tabs defaultValue="overview" className="w-full">
<TabsList variant="line" aria-label="Project">
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="deployments">Deployments</TabsTrigger>
<TabsTrigger value="logs">Logs</TabsTrigger>
</TabsList>
<TabsContent value="overview" className="py-4 text-muted">
The billing service runs in two regions.
</TabsContent>
<TabsContent value="deployments" className="py-4 text-muted">
38 deployments this month. None failed.
</TabsContent>
<TabsContent value="logs" className="py-4 text-muted">
The last error was three days ago.
</TabsContent>
</Tabs>The design system’s tabs: muted labels on a line, the selected one in the text colour over an accent underline. Only the colour changes, so nothing moves.
The default variant puts the tabs on a grey track and raises the selected one. Here the parent keeps the value, and a disabled tab is muted.
With hiddenUntilFound, the browser’s Find in page searches the panels that are not selected, and a match selects its tab. Try ⌘F or Ctrl+F for a city named in the Regions tab. In Safari, which cannot do this yet, the panels stay hidden as usual.
Tabs is the root; TabsList holds the TabsTrigger tabs; TabsContent is the panel for one tab. Each takes every prop of its element.