Tabs
A component for toggling between related panels on the same page.
Features
- Full keyboard navigation support with arrow keys
- Supports horizontal and vertical orientations
- Supports automatic and manual tab activation modes
- Content is lazy mounted by default
- Supports disabled tabs
Installation
typo3 ui:add tabs
Please copy the files manually from GitHub into your project.
Read more about installing Components and Primitives.
Examples
Vertical Orientation
Display tabs in a vertical layout.
Disabled Tabs
Disable specific tabs to prevent interaction.
Manual Activation
Require pressing Enter or Space to activate tabs instead of activating on focus.
API Reference
The following tables cover the available props of the Fluid Primitives. For a full list of available client side props and methods, see the Zag.js Machine API.
tabs.root
Provides shared tabs state and wraps the tab list and panels. Renders a <div> element.
| Name | Description | Required | Default |
|---|---|---|---|
loopFocus | booleanWhether the keyboard navigation will loop from last tab to first, and vice versa. | No | true |
defaultValue | stringThe initial selected tab value when rendered. Use when you don't need to control the selected tab value. | No | - |
orientation | Enum\OrientationThe orientation of the tabs. | No | Horizontal |
activationMode | Enum\TabsActivationModeThe activation mode of the tabs. | No | Automatic |
composite | booleanWhether the tab is composite. | No | true |
deselectable | booleanWhether the active tab can be deselected when clicking on it. | No | - |
tabs.list
Groups the tab triggers. Renders a <div> element.
tabs.trigger
Activates a tab and focuses its panel. Renders a <button> element.
| Name | Description | Required | Default |
|---|---|---|---|
value | stringThe value of the tab. | Yes | - |
disabled | booleanWhether the tab is disabled. | No | - |
tabs.indicator
Displays the active tab indicator. Renders a <div> element.
tabs.content
Displays the panel content for a tab. Renders a <div> element.
| Name | Description | Required | Default |
|---|---|---|---|
value | stringThe value of the tab. | Yes | - |
Anatomy
<primitives:tabs.root>
<primitives:tabs.list>
<primitives:tabs.trigger />
<primitives:tabs.indicator />
</primitives:tabs.list>
<primitives:tabs.content />
</primitives:tabs.root>