navigationcss

Tab

Underline and pill tablist styles with horizontal, bottom, and left/right layouts, plus a sliding active indicator driven by the Switcher controller.

CSS Variables

VariableDefaultScopeDescription
--z-tab-active-border-colorvar(--z-primary).z-tab > .z-active > a, .z-tab > .z-active > buttonBorder color of the active tab's underline or side bar.
--z-tab-active-border-color-o100%.z-tab > .z-active > a, .z-tab > .z-active > buttonOpacity applied to the active border color.
--z-tab-alt-active-bgvar(--z-bg).z-tab-altBackground of the active pill, also used by the sliding indicator.
--z-tab-alt-active-shadowvar(--z-global-shadow-small).z-tab-altShadow of the active pill and the sliding indicator.
--z-tab-alt-padding0.25rem.z-tab-altOuter padding of the pill tablist track.
--z-tab-alt-padding-inner0 0.75rem.z-tab-altInner padding of each pill tab link.
--z-tab-alt-radiusvar(--z-global-radius).z-tab-altCorner radius of the pill tablist track.
--z-tab-alt-radius-innervar(--z-global-radius-small).z-tab-altCorner radius of the active pill and the sliding indicator.
--z-tab-alt-transition150ms cubic-bezier(0.16, 1, 0.3, 1).z-tab-altTransition timing for pill color and indicator movement.
--z-tab-border-colorvar(--z-border).z-tabColor of the tablist baseline (the bottom border, or the side border in left/right layouts).
--z-tab-border-ovar(--z-border-o).z-tabOpacity applied to the baseline color.
--z-tab-font-sizevar(--z-global-font-size-small).z-tabFont size of tab links.
--z-tab-indicator-colorvar(--z-primary).z-tabColor of the sliding active indicator.
--z-tab-indicator-h · hook0px.z-tab[data-indicator-ready]::afterHeight of the active tab, written by the switcher at runtime to size the indicator.
--z-tab-indicator-o100%.z-tabOpacity applied to the indicator color.
--z-tab-indicator-w · hook0px.z-tab[data-indicator-ready]::afterWidth of the active tab, written by the switcher at runtime to size the indicator.
--z-tab-indicator-x · hook0px.z-tab[data-indicator-ready]::afterHorizontal offset of the active tab, written by the switcher at runtime to position the indicator.
--z-tab-indicator-y · hook0px.z-tab[data-indicator-ready]::afterVertical offset of the active tab, written by the switcher at runtime to position the indicator.
--z-tab-item-padding0.3125rem 0.625rem.z-tabPadding of each tab link.
--z-tab-link-colorvar(--z-muted-f).z-tab > * > a, .z-tab > * > buttonText color of inactive tab links.
--z-tab-link-color-o100%.z-tab > * > a, .z-tab > * > buttonOpacity applied to the inactive link color.
--z-tab-link-gap0.25em.z-tabGap between a tab link's icon and its label.
--z-tab-link-hover-colorvar(--z-bg-f).z-tab > * > a, .z-tab > * > buttonText color of tab links on hover.
--z-tab-link-hover-color-o100%.z-tab > * > a, .z-tab > * > buttonOpacity applied to the hover link color.
--z-tab-transition150ms cubic-bezier(0.16, 1, 0.3, 1).z-tabTransition timing for tab link color and indicator movement.

CSS Classes

ClassRoleApplies toDescription
.z-tabroot.z-tabUnderline tablist: a flex list of links or buttons sharing a baseline, with an active underline. Mark the active item .z-active and disabled items .z-disabled.
.z-tab-altelement.z-tabPill-style tablist variant: a rounded track whose active item is a raised pill. Use in place of .z-tab.
.z-tab-bottommodifier.z-tabMoves the baseline and the active border to the top edge of the tablist.
.z-tab-leftmodifier.z-tabVertical tablist drawn on the left side, with the baseline and active bar on its right edge.
.z-tab-rightmodifier.z-tabVertical tablist drawn on the right side, with the baseline and active bar on its left edge.