Tabs
Overview
Tabs are used to organize related content. They allow the user to navigate between groups of information that appear within the same context.
When to use:
- Use tabs to group related information into different categories, helping to reduce cognitive load.
- Tabs can be used to organize content such as forms, settings, and dashboards so a user does not have to navigate away from their workflow to complete their task.
When not to use:
- Tabs should never be used for primary navigation. If tabs become too complex, consider using a standard navigation pattern.
- Tabs should not be used to indicate progress. Use the progress indicator instead.
- Tabs should not be used if the user is comparing information in two groups, as this would result in the user having to click back and forth to complete a task.
Demo
Props
| Property | Description | Type | Values | Default | Required |
|---|---|---|---|---|---|
| variant | Variant for the tabs | TabsVariant | undefined | "underlined" | "filled" | "underlined" | |
| tabItems | Array of tab items | TabItem[] | TabItem[] | ✓ | |
| layout | Layout for the tabs | "aligned" | "spaced" | undefined | "aligned" | "spaced" | undefined | "aligned" | |
| stackIcon | Place the icon on top of the label or to the left of it | boolean | undefined | boolean | undefined |