Skip to content
Kimenpre-v1documentation home
Color scheme

ki-tab

One selectable tab inside a ki-tabs view switcher. It labels the peer content view sharing its value, with optional start and end slot media — never standalone.

Theme for this example
Color scheme for this example
Email Security Email delivery preferences Security and sign-in preferences
<ki-tabs label="Settings" value="email">
<ki-tab value="email">Email</ki-tab>
<ki-tab value="security">Security</ki-tab>
<ki-tab-panel value="email">Email delivery preferences</ki-tab-panel>
<ki-tab-panel value="security">Security and sign-in preferences</ki-tab-panel>
</ki-tabs>

When to use: label one peer content view inside ki-tabs, with optional decorative icon and start or end slot media.

When not to use: standalone, for form value selection, or for page navigation; use the parent group's value instead of authoring selected.

Properties & attributes

AttributePropertyTypeDefaultDescription
disableddisabledbooleanfalsePrevents selection by every modality and exposes the unavailable state. Boolean presence semantics apply: disabled="false" is still disabled.
selectedselectedbooleanfalseOutput-only selected state written by ki-tabs. Set the group's value to choose an initial tab; author-set selected is overwritten.
valuevaluestring''Pairing identifier shared with a ki-tab-panel. The first tab with a value owns it; later duplicates render but are not selectable.

Slots

SlotDescription
(default)Required visible text label and accessible name source.
endTrailing icon or media. Follows writing direction.
iconDecorative SVG. Supply visible text in the default slot.
startLeading icon or media. Follows writing direction.

CSS parts

PartDescription
indicatorDecorative selected-tab marker.
tabTab surface.

CSS custom properties

The public styling contract of ki-tab: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-density-control-offsetAdded to the block size of every scaled control and row (button, icon button, field, select, textarea, option, list item, tab). Components floor the result at ki.size.target-min.
--ki-density-target-minThe smallest pointer target any density may produce: 24 x 24 CSS px by default and in compact (WCAG 2.5.8 AA), 44 x 44 in touch (WCAG 2.5.5). It floors a shrinking control but never lifts what a control paints: a control painted smaller extends its target to it, invisibly; rows and tabs grow to it (spec 045 A1).
--ki-motion-distance-xsMotion travel distance xs (2px): hover-lift offsets.
--ki-motion-duration-fastFast interaction transition duration.
--ki-motion-easing-outDecelerating interaction transition easing curve.
--ki-motion-easing-standardStandard interaction transition easing curve.
--ki-tab-backdrop-filterComplete backdrop filter for a tab surface.
--ki-tab-bg-imageOptional surface image for a tab.
--ki-tab-focus-ring-colorcolor used by the tab component for focus ring color.
--ki-tab-focus-ring-offsetdimension used by the tab component for focus ring offset.
--ki-tab-focus-ring-shadowshadow used by the tab component for the focus ring glow (MarsUI Focus/primary: 3px spread ring at 20% — see ki.focus.primary. specs/002-ki-button/design-extraction.md §2.5 recorded 40%, having read the alpha off the Dark canvas mode, same double mechanism as ki-button: glow plus the opaque indicator).
--ki-tab-focus-ring-widthdimension used by the tab component for focus ring width.
--ki-tab-font-sizedimension used by the tab component for font size.
--ki-tab-font-weightfont weight used by the tab component for font weight.
--ki-tab-gapdimension used by the tab component for gap.
--ki-tab-icon-inline-gapGap from an inline tab icon to its label.
--ki-tab-icon-sizeInline and block size of a decorative tab icon.
--ki-tab-indicator-colorcolor used by the tab component for indicator color (MarsUI active underline is Outline/inverse_white: black in light, white in dark — the inverse neutral, not primary).
--ki-tab-indicator-radiusdimension used by the tab component for indicator radius (the master underline is a square-ended 2px bottom border).
--ki-tab-indicator-sizedimension used by the tab component for indicator size.
--ki-tab-line-heightdimension used by the tab component for line height.
--ki-tab-min-block-sizedimension used by the tab component for min block size (MarsUI Tab_nav md bar height 40px: 24px body_1 label + 8px block-end clearance + underline; retargeted from ki.space.7xl per the fidelity audit — material3 pins its own value).
--ki-tab-padding-block-enddimension used by the tab component for padding block end (MarsUI Tab_nav_item: 8px inset keeping the 2px underline clear of the 13/24 label; formalizes the fallback ki-tab.css already consumes).
--ki-tab-padding-inlinedimension used by the tab component for padding inline (MarsUI items carry no inline padding: spacing comes from the bar gap and the underline spans the full item width).
--ki-tab-radiusdimension used by the tab component for radius.
--ki-tab-selected-active-bgcolor used by the tab component for selected active background (MarsUI Tab_nav is transparent_inverse in every state; background pills are Switcher language).
--ki-tab-selected-active-fgcolor used by the tab component for selected active foreground (MarsUI active tab label is neutral Text/high_em — never purple; master 10048:1240).
--ki-tab-selected-disabled-bgcolor used by the tab component for selected disabled background (no disabled variant exists in Tab_nav; disabled must be quieter than rest, not a filled pill).
--ki-tab-selected-disabled-fgcolor used by the tab component for selected disabled foreground (MarsUI disabled ladder: Gray/500 light / White-32 dark, the value ki-status and ki-switch already use for disabled glyphs).
--ki-tab-selected-hover-bgcolor used by the tab component for selected hover background (MarsUI Tab_nav is transparent_inverse in every state; background pills are Switcher language).
--ki-tab-selected-hover-fgcolor used by the tab component for selected hover foreground (MarsUI active tab label is neutral Text/high_em — never purple; master 10048:1240).
--ki-tab-selected-rest-bgcolor used by the tab component for selected rest background (MarsUI Tab_nav is transparent_inverse in every state; background pills are Switcher language).
--ki-tab-selected-rest-fgcolor used by the tab component for selected rest foreground (MarsUI active tab label is neutral Text/high_em — never purple; master 10048:1240).
--ki-tab-unselected-active-bgcolor used by the tab component for unselected active background (MarsUI Tab_nav is transparent_inverse in every state).
--ki-tab-unselected-active-fgcolor used by the tab component for unselected active foreground (mirrors hover; MarsUI defines no pressed variant).
--ki-tab-unselected-disabled-bgcolor used by the tab component for unselected disabled background (no disabled variant exists in Tab_nav; disabled must be quieter than rest, not a filled pill).
--ki-tab-unselected-disabled-fgcolor used by the tab component for unselected disabled foreground (MarsUI disabled ladder: Gray/500 light / White-32 dark, the value ki-status and ki-switch already use for disabled glyphs).
--ki-tab-unselected-hover-bgcolor used by the tab component for unselected hover background (MarsUI Tab_nav is transparent_inverse in every state).
--ki-tab-unselected-hover-fgcolor used by the tab component for unselected hover foreground (with rest at med_em, hover darkens one em step, preserving the master rest-to-hover direction).
--ki-tab-unselected-rest-bgcolor used by the tab component for unselected rest background (MarsUI Tab_nav is transparent_inverse in every state).
--ki-tab-unselected-rest-fgcolor used by the tab component for unselected rest foreground (Figma inactive is Text/low_em, which fails the 4.5:1 text gate at 13px; med_em is the gate-compliant rest value — declared deviation).
--ki-typography-family-bodysemantic font family for typography family body.

Selection is owned by the parent group: set ki-tabs’ value instead of authoring selected. A disabled tab stays visible but cannot be selected by any modality.

Documented with its parent: open ki-tabs in Storybook