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
| Variable | Default | Scope | Description |
|---|---|---|---|
--z-tab-active-border-color | var(--z-primary) | .z-tab > .z-active > a, .z-tab > .z-active > button | Border color of the active tab's underline or side bar. |
--z-tab-active-border-color-o | 100% | .z-tab > .z-active > a, .z-tab > .z-active > button | Opacity applied to the active border color. |
--z-tab-alt-active-bg | var(--z-bg) | .z-tab-alt | Background of the active pill, also used by the sliding indicator. |
--z-tab-alt-active-shadow | var(--z-global-shadow-small) | .z-tab-alt | Shadow of the active pill and the sliding indicator. |
--z-tab-alt-padding | 0.25rem | .z-tab-alt | Outer padding of the pill tablist track. |
--z-tab-alt-padding-inner | 0 0.75rem | .z-tab-alt | Inner padding of each pill tab link. |
--z-tab-alt-radius | var(--z-global-radius) | .z-tab-alt | Corner radius of the pill tablist track. |
--z-tab-alt-radius-inner | var(--z-global-radius-small) | .z-tab-alt | Corner radius of the active pill and the sliding indicator. |
--z-tab-alt-transition | 150ms cubic-bezier(0.16, 1, 0.3, 1) | .z-tab-alt | Transition timing for pill color and indicator movement. |
--z-tab-border-color | var(--z-border) | .z-tab | Color of the tablist baseline (the bottom border, or the side border in left/right layouts). |
--z-tab-border-o | var(--z-border-o) | .z-tab | Opacity applied to the baseline color. |
--z-tab-font-size | var(--z-global-font-size-small) | .z-tab | Font size of tab links. |
--z-tab-indicator-color | var(--z-primary) | .z-tab | Color of the sliding active indicator. |
--z-tab-indicator-h · hook | 0px | .z-tab[data-indicator-ready]::after | Height of the active tab, written by the switcher at runtime to size the indicator. |
--z-tab-indicator-o | 100% | .z-tab | Opacity applied to the indicator color. |
--z-tab-indicator-w · hook | 0px | .z-tab[data-indicator-ready]::after | Width of the active tab, written by the switcher at runtime to size the indicator. |
--z-tab-indicator-x · hook | 0px | .z-tab[data-indicator-ready]::after | Horizontal offset of the active tab, written by the switcher at runtime to position the indicator. |
--z-tab-indicator-y · hook | 0px | .z-tab[data-indicator-ready]::after | Vertical offset of the active tab, written by the switcher at runtime to position the indicator. |
--z-tab-item-padding | 0.3125rem 0.625rem | .z-tab | Padding of each tab link. |
--z-tab-link-color | var(--z-muted-f) | .z-tab > * > a, .z-tab > * > button | Text color of inactive tab links. |
--z-tab-link-color-o | 100% | .z-tab > * > a, .z-tab > * > button | Opacity applied to the inactive link color. |
--z-tab-link-gap | 0.25em | .z-tab | Gap between a tab link's icon and its label. |
--z-tab-link-hover-color | var(--z-bg-f) | .z-tab > * > a, .z-tab > * > button | Text color of tab links on hover. |
--z-tab-link-hover-color-o | 100% | .z-tab > * > a, .z-tab > * > button | Opacity applied to the hover link color. |
--z-tab-transition | 150ms cubic-bezier(0.16, 1, 0.3, 1) | .z-tab | Transition timing for tab link color and indicator movement. |
CSS Classes
| Class | Role | Applies to | Description |
|---|---|---|---|
.z-tab | root | .z-tab | Underline 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-alt | element | .z-tab | Pill-style tablist variant: a rounded track whose active item is a raised pill. Use in place of .z-tab. |
.z-tab-bottom | modifier | .z-tab | Moves the baseline and the active border to the top edge of the tablist. |
.z-tab-left | modifier | .z-tab | Vertical tablist drawn on the left side, with the baseline and active bar on its right edge. |
.z-tab-right | modifier | .z-tab | Vertical tablist drawn on the right side, with the baseline and active bar on its left edge. |