Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Tabs

Related views with matching triggers and panels.

Preview

Live preview

Changes apply to this preview only.

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Anatomy

Tabs, TabsList, TabsTrigger and TabsContent; the disabled Settings trigger is skipped by click and keyboard navigation.

Open preview

Variants

Enumerated from tabsVariantMap: line, solid and soft here; the segmented variant has its own section below.

Open preview

Segmented

A neutral pill track with an elevated active segment. Dividers separate inactive segments; the vertical form becomes a menu; the scrollable form adds previous/next buttons when the tabs overflow.

Open preview

Usage

Each trigger and panel share a value. Use defaultValue for an internal selection, or value/onValueChange to control it.

Choose line or segmented variants from tabsVariantMap. manual activation separates arrow focus from selection when switching content is expensive.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluTabsProps

Type source
PimoluTabsProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—TabsList and the TabsContent panels.
defaultValuestring | undefined—Initial selection when uncontrolled.
valuestring | undefined—Controlled selection.
onValueChange((value: string) => void) | undefined—Called whenever the selected value changes.
orientationPimoluTabsOrientation | undefined"horizontal"Direction of the keyboard arrows and of the layout. Defaults to "horizontal".
activationModePimoluTabsActivationMode | undefined"automatic""automatic" selects a tab as soon as an arrow reaches it; "manual" only moves focus and waits for Enter or Space. Defaults to "automatic".
variant"solid" | "soft" | "line" | "segmented" | undefined"line"Visual treatment. Defaults to "line".
size"sm" | "md" | "lg" | undefined"md"Trigger height and font size. Defaults to "md".
classNamestring | undefined—Class applied to the root.
childrenRequired

ReactNode

No default extracted.

TabsList and the TabsContent panels.

defaultValue

string | undefined

No default extracted.

Initial selection when uncontrolled.

value

string | undefined

No default extracted.

Controlled selection.

onValueChange

((value: string) => void) | undefined

No default extracted.

Called whenever the selected value changes.

orientation

PimoluTabsOrientation | undefined

Default: "horizontal"

Direction of the keyboard arrows and of the layout. Defaults to "horizontal".

activationMode

PimoluTabsActivationMode | undefined

Default: "automatic"

"automatic" selects a tab as soon as an arrow reaches it; "manual" only moves focus and waits for Enter or Space. Defaults to "automatic".

variant

"solid" | "soft" | "line" | "segmented" | undefined

Default: "line"

Visual treatment. Defaults to "line".

size

"sm" | "md" | "lg" | undefined

Default: "md"

Trigger height and font size. Defaults to "md".

className

string | undefined

No default extracted.

Class applied to the root.

PimoluTabsListProps

Type source
PimoluTabsListProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
aria-labelstring | undefined—Accessible name of the tablist.
aria-labelledbystring | undefined—Id of the element that names the tablist.
dividersboolean | undefinedfalseAdd separators between the segments of the `segmented` variant. Defaults to false.
scrollableboolean | undefinedfalseKeep a horizontal list on one line and scroll it, with previous/next buttons when it overflows. Defaults to false.
scrollPreviousLabelstring | undefined"Previous tabs"Accessible name of the previous-tabs button.
scrollNextLabelstring | undefined"Next tabs"Accessible name of the next-tabs button.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

aria-label

string | undefined

No default extracted.

Accessible name of the tablist.

aria-labelledby

string | undefined

No default extracted.

Id of the element that names the tablist.

dividers

boolean | undefined

Default: false

Add separators between the segments of the `segmented` variant. Defaults to false.

scrollable

boolean | undefined

Default: false

Keep a horizontal list on one line and scroll it, with previous/next buttons when it overflows. Defaults to false.

scrollPreviousLabel

string | undefined

Default: "Previous tabs"

Accessible name of the previous-tabs button.

scrollNextLabel

string | undefined

Default: "Next tabs"

Accessible name of the next-tabs button.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluTabsTriggerProps

Type source
PimoluTabsTriggerProps public API
NameTypeDefaultDescription
valueRequiredstring—Value shared with the matching TabsContent.
disabledboolean | undefinedfalseSkip the tab in click and arrow navigation.
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
valueRequired

string

No default extracted.

Value shared with the matching TabsContent.

disabled

boolean | undefined

Default: false

Skip the tab in click and arrow navigation.

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluTabsContentProps

Type source
PimoluTabsContentProps public API
NameTypeDefaultDescription
valueRequiredstring—Value shared with the matching TabsTrigger.
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
valueRequired

string

No default extracted.

Value shared with the matching TabsTrigger.

childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

Accessibility

  • Name TabsList with aria-label or aria-labelledby.
  • Horizontal arrows move across horizontal tabs; check vertical navigation when orientation is vertical. Disabled tabs are skipped.
Read the accessibility guide →