Tabs

Switchable panels with an animated indicator, five variants and full keyboard support.

The line variant slides its indicator between triggers.

Import#

import { Tabs } from "astralis-ui";
// Tabs.List, Tabs.Trigger, Tabs.Content

Variants#

line slides a measured indicator under the active trigger; segmented raises it on a track; outline gives folder tabs. Individual triggers can be disabled.

line
subtle
segmented
outline
plain

Vertical#

orientation="vertical" stacks the list and flips the arrow-key axis — the settings-page classic.

Name, avatar, bio.

Fitted and rounded#

fitted stretches triggers across the list; with segmented + rounded it becomes the familiar pill switcher.

Props#

PropTypeDefaultDescription
value · defaultValue · onValueChangestring · string · (value: string) => voidControlled / initial tab, and the change callback.
variant"line" | "subtle" | "segmented" | "outline" | "plain""line"Underline with sliding indicator, filled pill, raised track, folder tabs, or minimal.
colorSchemeColorScheme"brand"Hue for the active tab, sliding indicator, and focus rings (via the accent channel).
size"sm" | "md" | "lg""md"Trigger padding and text size.
orientation"horizontal" | "vertical""horizontal"Layout and arrow-key axis.
fittedbooleanfalseStretch triggers to fill the list width.
roundedbooleanfalsePill radii for the subtle/segmented/outline variants.
activationMode"automatic" | "manual""automatic"Whether arrow-key focus selects immediately, or Enter/Space confirms.
keepMountedbooleanfalseHide inactive panels instead of unmounting them.
loopbooleantrueArrow-key focus wraps around the ends.

Parts#

PropTypeDefaultDescription
Tabs.Triggervalue: string · disabled?: booleanOne tab button; value links it to its panel.
Tabs.Contentvalue: stringThe panel shown while its value is active.

Keyboard#

KeyAction
/ Move focus between tabs ( / when vertical); wraps with loop
Home / EndFirst / last tab
Enter / SpaceSelect the focused tab

With activationMode="automatic" (the default), moving focus also selects. With "manual", focus moves freely and Enter/Space commits — use it for panels that are expensive to switch.

Accessibility#

  • Real tablist/tab/tabpanel roles with aria-selected and aria-controls wiring.
  • Roving tabindex: one Tab stop for the whole list, arrows move within it.