Skip to content

Tabs โ€‹

A tab strip with sizes, color variants, three visual styles (underline / pill / ghost), optional count badges, optional SVG icons via slot, and per-item disabled state. Content panes live outside the strip โ€” drive them off the bound model-value. Toggle Vue / CSS to switch the live demo and source together.

The strip IS Basecoat's [role="tablist"] (see Theme). pill is upstream's default โ€” a bg-muted track, rounded-lg p-[3px] h-9, with the selected tab lifted onto bg-background shadow-sm โ€” and underline is its [data-variant="line"]: a bare track where the selected tab is marked by a 2px bar. Tabs are text-sm font-medium, inked foreground/60 until hovered or selected. Dark mode is built in.

Basic โ€‹

Three tabs with text panes that swap on click.

Vue SFC

Sizes โ€‹

Small, medium and large.

Vue SFC

Colors โ€‹

Pick a colour and every variant takes it. All built-in colors across underline, pill and ghost.

Vue SFC

Badges โ€‹

Tabs with trailing count badges.

Vue SFC

Icons โ€‹

Leading SVG icons via the icon-{id} slot.

Vue SFC

Disabled โ€‹

Whole-strip disabled, plus per-item disabled.

Vue SFC

Event log โ€‹

Live log of change events.

Vue SFC

Customized โ€‹

Override per-element styling with cssClass (Vue) or utility classes (CSS).

Vue SFC

CSS Variables โ€‹

Vue SFC

Every tab strip is themed through --mono-tabs-* custom properties. Setting one on the element, on any wrapper/ancestor, or inline all work โ€” custom properties inherit, and they pierce the shadow-DOM boundary, so the same overrides apply to <mono-tabs> and the shadow build. The size and color props set presets, but an explicit --mono-tabs-* override always wins. To re-skin globally, set the underlying tokens (--muted, --foreground, --background โ€ฆ) or switch flavor.

VariableDefaultControls
--mono-tabs-accent / -<role>--primary / the ten rolesThe colour the selected tab and the bar take (set by color)
--mono-tabs-text / -muted--foreground / --mono-mode-tab-inactive-fg (foreground/60, dark --muted-foreground)Hovered / selected ink, and the idle ink
--mono-tabs-bg (alias -background)--mutedThe pill track's fill
--mono-tabs-height-<size> / -radius-<size> / -padding-<size>h-9 / --mono-radius-lg / 3px at mdThe track's box (rounded-lg p-[3px] h-9)
--mono-tabs-strip-gap0 pill, --mono-spacing lineGap between tabs
--mono-tabs-tab-radius-<size> / -tab-pad-x-<size> (alias -pad-x) / -tab-pad-y-<size> (alias -pad-y)--mono-radius-md / px-2 / py-1A tab's box
--mono-tabs-tab-font-<size> (alias -font) / -tab-font-weight (alias -font-weight) / -tab-text-transform (alias -text-transform) / -tab-letter-spacing--mono-text-sm / medium / none / normalA tab's label
--mono-tabs-tab-gap-<size> (alias -gap)1.5 ร— --mono-spacingGap between icon / label / badge
--mono-tabs-active-bg (alias -surface) / -active-border / -active-shadow / -active-color--mono-mode-tab-active-bg / โ€ฆ / --mono-shadow-sm / the roleThe selected PILL
--mono-tabs-line-color / -line-size / -line-offsetthe role / 2px / -5pxThe selected tab's bar in the line variant
--mono-tabs-line-track-color / -line-track-sizetransparent / the bar's sizeA full-width rule under the line strip. Upstream has none โ€” this is how the pre-port baseline is restored (and how ONE keeps it)
--mono-tabs-ghost-hover-bg / -ghost-active-bg--mono-mode-ghost-hover / the role at --mono-mode-tintThe ghost variant
--mono-tabs-icon-size-<size> / -tab-icon-padsize-4 / 1.5 ร— --mono-spacingThe glyph box, and the tuck-in on the side a tab leads or trails with one
--mono-tabs-badge-size / -badge-font / -badge-bg / -badge-color / -badge-active-bg / -badge-active-color4.5 ร— --mono-spacing / --mono-text-xs / foreground/10 / the idle ink / the role / --primary-foregroundThe count badge (EXTENSION โ€” upstream has none)
--mono-tabs-ring-color / -ring-width--ring / --mono-ring-widthThe focus ring

Types โ€‹

Importimport { TabsProps } from 'mono-helper'
PropValueDefaultDescription
itemsTabItem[]โ€”List of tabs to render.
modelValuestringโ€”Two-way bound id of the active tab.
valuestringโ€”Id of the active tab (kept in sync with modelValue).
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'โ€”Size of the tabs.
color'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'teal' | 'purple' | 'neutral' | 'dark'โ€”Color theme of the tabs.
variant'underline' | 'pill' | 'ghost'โ€”Visual style of the tabs.
orientation'horizontal' | 'vertical'โ€”Which way the strip runs (default `horizontal`). Sets the tablist's `aria-orientation`, which is what the vertical styling keys on.
disabledbooleanโ€”Disables interaction with all tabs.
cssClassTabsCssClassโ€”Per-part class overrides for styling internal elements.