Sections of one surface that the reader switches between; only the chosen section is rendered. underline is for the sections of a page or a record, with an ink rule under the chosen tab; segmented sits inside a card, a drawer or a panel. A count after the label is a neutral Badge. Arrow keys move between tabs, and a disabled tab is skipped.
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@puckoops/camelot";| Name | Description | Default | Control |
|---|---|---|---|
| defaultValue | string | - | |
| onValueChange | function | - | - |
| activationMode | manual waits for Enter or Space string | - | |
| variant | underline for the sections of a page or record; segmented inside a card, drawer or panel. "underline""segmented" | "underline" |
Also takes ComponentPropsWithoutRef<typeof RTabs.Root>.
Use Tabs when each option shows a different section below, such as Overview · Tasks · Files on a project. Underline is the default; segmented sits inside a card, a drawer or a panel. Keep labels to one or two words and put a count on the tab rather than in its label.
Inside a panel: the chosen tab rises onto the surface.
One or two words per tab.
Nordvik Atelier, Oslo. Client since March 2024.
Files is unavailable until the project has a folder; the arrow keys skip it.
Segmented tabs, controlled, at the top of a card.
14 tasks due, 3 invoices to send.
Both variants with counts and a disabled tab.
underline
segmented