For more examples, visit the Storybook.

Example
<StudsTabs defaultValue="account">
  <StudsTabsList>
    <StudsTabsTrigger value="account">Account</StudsTabsTrigger>
    <StudsTabsTrigger value="password">Password</StudsTabsTrigger>
  </StudsTabsList>
  <StudsTabsContent value="account">
    Account tab content
  </StudsTabsContent>
  <StudsTabsContent value="password">
    Password tab content
  </StudsTabsContent>
</StudsTabs>

StudsTabs Props

asChild
boolean

If true, the component will render as a child of the parent component.

defaultValue
string

The value of the tab that should be active when initially rendered.

value
string

The controlled value of the active tab. Should be used with onValueChange.

onValueChange
function

Callback that fires when the active tab is changed.

orientation
"horizontal" | "vertical"

The orientation of the tabs.

dir
"ltr" | "rtl"

The direction of the tabs.

activationMode
"manual" | "automatic"

The activation mode of the tabs.

StudsTabsList Props

asChild
boolean

If true, the component will render as a child of the parent component.

loop
boolean
default:"true"

If true, the tabs will loop when navigating.

StudsTabsTrigger Props

asChild
boolean

If true, the component will render as a child of the parent component.

value
string

A unique value that associates the trigger with a content panel.

disabled
boolean

When true, prevents the user from interacting with the tab.

StudsTabsContent Props

asChild
boolean

If true, the component will render as a child of the parent component.

value
string

A unique value that associates the content with a trigger.

forceMount
boolean

Used to force mounting when more control is needed.