Skip to content
Components / Collections

Tabs

Switch between peer views of the same subject.

@fabrials/ui
Loading state
420 requests in June.
A vertical rail: the current row has a Stormlight bar.

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { Tabs, TabsList, TabsTrigger, TabsContent } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
defaultValuestringThe panel shown first.
valuestringMatches a trigger to its panel.
Tabs orientationhorizontal | verticalvertical makes a rail beside the panel: the list sits on the sidebar surface, the current row is the sidebar accent with a 2 px Stormlight bar on the inline-start edge, and the arrow keys move up and down.
TabsList scrollableboolean | narrowOne line that scrolls sideways instead of wrapping: no scrollbar, snap to the tabs, and the selected tab is kept in view (the list scrolls its own box, never the page; right to left works). true is always; narrow only below 48rem of viewport.
TabsList variantunderline | segmentedunderline by default.

Behavior

Each trigger names its panel. Do not use tabs for a step sequence. The indicator follows the active tab's own edge, so a list that wraps onto two rows still underlines the right one.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.