- components
 - ›
 - tabs
 - ›
 - svelte
 
Tabs
Use tabs to quickly switch between different views and pages.
Content for Tab 1
 Content for Tab 2
 Content for Tab 3
Fluid Width
Content for Tab 1
 Content for Tab 2
 Content for Tab 3
Vertical
Content for Tab 1
 Content for Tab 2
 Content for Tab 3
Direction
Content for Tab 1
 Content for Tab 2
 Content for Tab 3
API Reference
Root
| Property | Default | Type | 
|---|---|---|
 ids  |  - |    Partial<{ root: string; trigger: (value: string) => string; list: string; content: (value: string) => string; indicator: string; }> | undefined The ids of the elements in the tabs. Useful for composition.  |  
 translations  |  - |    IntlTranslations | undefinedSpecifies the localized strings that identifies the accessibility elements and their states  |  
 loopFocus  |  true |    boolean | undefinedWhether the keyboard navigation will loop from last tab to first, and vice versa.  |  
 value  |  - |    string | null | undefinedThe controlled selected tab value  |  
 defaultValue  |  - |    string | null | undefinedThe initial selected tab value when rendered. Use when you don't need to control the selected tab value.  |  
 orientation  |  "horizontal" |    "horizontal" | "vertical" | undefinedThe orientation of the tabs. Can be `horizontal` or `vertical` - `horizontal`: only left and right arrow key navigation will work. - `vertical`: only up and down arrow key navigation will work.  |  
 activationMode  |  "automatic" |    "manual" | "automatic" | undefinedThe activation mode of the tabs. Can be `manual` or `automatic` - `manual`: Tabs are activated when clicked or press `enter` key. - `automatic`: Tabs are activated when receiving focus  |  
 onValueChange  |  - |    ((details: ValueChangeDetails) => void) | undefinedCallback to be called when the selected/active tab changes  |  
 onFocusChange  |  - |    ((details: FocusChangeDetails) => void) | undefinedCallback to be called when the focused tab changes  |  
 composite  |  - |    boolean | undefinedWhether the tab is composite  |  
 deselectable  |  - |    boolean | undefinedWhether the active tab can be deselected when clicking on it.  |  
 navigate  |  - |    ((details: NavigateDetails) => void) | null | undefinedFunction to navigate to the selected tab when clicking on it. Useful if tab triggers are anchor elements.  |  
 dir  |  "ltr" |    "ltr" | "rtl" | undefinedThe document's text/writing direction.  |  
 getRootNode  |  - |    (() => ShadowRoot | Node | Document) | undefinedA root node to correctly resolve document in custom environments. E.x.: Iframes, Electron.  |  
 element  |  - |    Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself  |  
RootProvider
| Property | Default | Type | 
|---|---|---|
 value  |  - |    () => TabsApi<PropTypes>  |  
 element  |  - |    Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself  |  
RootContext
| Property | Default | Type | 
|---|---|---|
 children  |  - |    Snippet<[() => TabsApi<PropTypes>]>  |  
List
| Property | Default | Type | 
|---|---|---|
 element  |  - |    Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself  |  
Trigger
| Property | Default | Type | 
|---|---|---|
 value  |  - |    stringThe value of the tab  |  
 disabled  |  - |    boolean | undefinedWhether the tab is disabled  |  
 element  |  - |    Snippet<[HTMLAttributes<"button">]> | undefinedRender the element yourself  |  
Indicator
| Property | Default | Type | 
|---|---|---|
 element  |  - |    Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself  |  
Content
| Property | Default | Type | 
|---|---|---|
 value  |  - |    stringThe value of the tab  |  
 element  |  - |    Snippet<[HTMLAttributes<"div">]> | undefinedRender the element yourself  |