A single tab within a nana-tab-group. Place tabs in the group’s nav slot and link each to a panel via the panel attribute. The host element is the focusable tab (role="tab"), so assistive tech and the group’s roving-tabindex navigation operate on a single element.
Whether the tab is the active/selected one (managed by the group).
closable
—
boolean
false
Show a close button.
count
—
string | number | undefined
—
Optional count shown as a small badge after the label.
disabled
—
boolean
false
Disable the tab.
panel
—
string
''
The name of the panel this tab controls (matches a panel's `name`).
size
—
TabSize
'md'
Tab size. Usually set automatically by the parent `nana-tab-group`.
variant
—
TabVariant
'underline'
Visual style. Usually set automatically by the parent `nana-tab-group`.
Events
Event
Description
nana-tab-close
Emitted when the tab is closed via the button or Delete / Backspace (`detail.panel`).
Slots
Slot
Description
(default)
The tab's label.
prefix
Content before the label, typically an icon.
suffix
Content after the label, e.g. a count badge.
CSS parts
Part
Description
::part(base)
The tab's inner container.
::part(count)
The built-in count badge.
::part(close-button)
The close button (when `closable`).
CSS custom properties
Property
Description
--nana-tab-hover-bg
Hover fill for the pill, filled and ghost variants. Defaults to a translucent tint of the text colour, so it reads on any surface; set an opaque colour to pin it.
--nana-tab-active-bg
Fill of the active thumb in the segmented variant.
--nana-tab-inactive-color
Label colour of an unselected tab. Defaults to the muted text step, which clears 4.5:1 on the segmented track; check contrast before recessing it further.
Hover fill for the pill, filled and ghost variants. Defaults to a translucent tint of the text colour, so it reads on any surface; set an opaque colour to pin it.
--nana-tab-active-bg
—
Fill of the active thumb in the segmented variant.