Figma component
Overview
Tabs let users switch between related views of the same context while keeping every view visible. The selected tab is underlined, and the content panel below it changes.
Status: in review. The design is ready in Figma. The code component (nv-tabs, nv-tabitem) is in review and not released yet.
Key features
- Composable: a Tabs container with an Items slot; each tab item is configured on its own.
- Four states: Default, Hover, Active and Disabled.
- Optional content: leading icon, trailing icon and notification bullet on each item.
- Optional separator: a baseline across the full width, independent of the active underline.
- Wrapping: items hug their content and wrap when space is reduced.
- Themes: Spark and Ocean, light and dark.
Anatomy
- Tab item: one selectable view.
- Leading icon (optional): reinforces the meaning of the label.
- Label: short name of the view.
- Notification (optional): count of new items in the view.
- Trailing icon (optional).
- Active underline: marks the selected tab.
- Separator (optional): baseline across the container width.
Properties
|
Figma |
Code |
Notes |
|---|---|---|
|
Items (slot) |
default slot of nv-tabs |
Add, remove or reorder tab items. |
|
Show separator |
show-separator |
Default: false. Does not change the active underline. |
|
State (on item) |
value on nv-tabs, disabled on nv-tabitem |
In code, the container owns the selection; hover comes from the browser. |
|
Label |
label |
Required. Keep it short. The label stays on one line. |
|
Show leading icon, Leading icon |
leading-icon |
Icon name; hidden when absent. |
|
Show trailing icon, Trailing icon |
trailing-icon |
Icon name; hidden when absent. |
|
Has notification, Number |
notification |
Absent or 0 means hidden; the badge appears from 1. |
|
— |
panel-id |
Code only. Required. ID of the panel the tab controls. |
|
— |
valueChanged on nv-tabs |
Code only. Emitted with the new value when the selection changes without your code setting it: the user selects a tab, or the selected tab is removed or disabled. Supports two-way binding. |
|
— |
value on nv-tabitem |
Code only. Required. Identifies the tab; unique in the group. A tab without value, label or panel-id writes a console warning. |
|
— |
notification-label |
Code only. What screen readers announce for the count; {count} is replaced by the number. Default: Notifications: {count}. Translate it into the language of your application. |
|
— |
aria-label or aria-labelledby on nv-tabs |
Code only. Names the tab list for screen readers. Always set one. |
Look and feel
States
- Default: an enabled tab at rest.
- Hover: pointer feedback on an enabled tab.
- Active: the selected view; label, icons and underline use the active colors.
- Disabled: an unavailable view, with reduced opacity.
Item content
Add icons and notifications only when they help users recognise the view. Each option is independent.
Separator
Themes
Spark and Ocean, in light and dark mode.
Behavior
- Tabs are horizontal. Vertical tabs are out of scope.
- One enabled tab is selected per group. If no value is set, the first enabled tab is selected.
- If the selected tab is removed or disabled, the next enabled tab is selected, otherwise the previous one.
- Items keep their source order when they wrap. There is no scrolling or overflow menu.
- The application owns the panels: it shows the panel that matches the selected tab.
- In Figma, set exactly one item to Active; siblings are not updated automatically.
- Tabs never open a menu: there is no chevron and no dropdown.
Accessibility
- Uses the tablist, tab and tabpanel roles. The group has a label, and each tab is connected to its panel.
- Keyboard: Left and Right move focus, Enter or Space selects, Home and End reach the first and last enabled tab. The group is a single Tab stop.
- Disabled tabs are skipped by arrow keys and cannot be activated.
- Decorative icons are hidden from assistive technologies. A notification count gets an accessible description without replacing the label. Set notification-label to translate it.
- Selection is shown by an underline as well as by color.
Usage
Use short labels and keep exactly one active tab.
Don't write sentences as labels, and don't mark several tabs as active.
Related
- Navbar: for navigation between product destinations, use Navbar instead of Tabs.
- Togglegroup: to switch a setting or a filter, use Togglegroup.
Links
The Figma file contains the latest UI designs. Links to Web Component, Blazor, Angular, React and VueJS will be added once the component is released.
Feedback
Have feedback, an idea, or a bug to report? Head over to our Contributions page.