Tabs
The Tabs component organizes content into multiple panels, allowing users to switch between views easily. Ideal for sectioned content like settings, product details, or data categories, Tabs create a clean, accessible way to navigate related information within a single interface.
Make changes to your account here. Click save when you're done.
Change your password here. After saving, you'll be logged out.
Structure
API Reference
x-data="tabs"
The root component containing the state and functionality.
Property | Type | Description | Default |
---|---|---|---|
initialActive | string | The initial active tab value | "" |
orientation | enum "horizontal" | "vertical" | The orientation of the tabs. Used for the arrow key control and aria-attribute | horizontal |
label | string | The label for the tabs component. The tablist element should have an aria-label. Alternatively you can add an element with x-ref="label" wich will be used for aria-labelledby. | "" |
urlSync | enum "hash" | "search" | false | The method for syncing the active tab with the URL, either via search parameters or hash. | false |
onActiveTabChange | function | A callback function that is called when the active tab changes | null |
x-data="tabTrigger"
A trigger element for a tab.
Property | Type | Description | Default |
---|---|---|---|
value | string | The unique value of the tab trigger to link it with a content slide | "" |
x-data="tabContent"
A content element for a tab.
Property | Type | Description | Default |
---|---|---|---|
value | string | The unique value of the tab content to link it with a trigger | "" |