Tabs <pm-tabs>
Tabs that switch between panels of related content, with keyboard support, overflow scrolling and closable tabs.
Variants
Set with the variant attribute.
variant="line"variant="pills"Tones
Set tone on the element, or data-tone on any ancestor to tone a whole area.
tone="accent"tone="secondary"tone="neutral"tone="success"tone="warning"tone="danger"tone="info"Overview
Children: <pm-tab> (tabs) and <pm-tab-panel> (panels), matched by order. Arrow keys, Home/End; selection follows focus (activation="manual": Enter/Space selects). Horizontal or orientation="vertical" (a column beside the panel; on screens narrower than 40rem it is a row again, with the arrow keys to match). Overflowing tab lists scroll and show arrow buttons. closable tabs close with their ✕ or the Delete key; disabled tabs are skipped. Panels use hidden="until-found" (find-in-page).
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
selected | number | 0 | Whether this item is selected. |
label | string | — | Accessible name of the tab list. |
variant | 'line' | 'pills' | — | Visual style. |
orientation | 'horizontal' | 'vertical' | — | Tab list direction. |
activation | 'auto' | 'manual' | — | auto (default): arrow keys select. manual: arrow keys move focus, Enter/Space selects. |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Events
| Event | React / Svelte prop | Description |
|---|---|---|
pm-change | onPmChange | Another tab was selected. |
pm-close | onPmClose | A tab is about to close (its close button, the Delete key or close()). Cancelable; by default the tab and its panel are removed. |
Methods
close(), select()
<pm-tab>
A tab in pm-tabs; matched to the pm-tab-panel at the same index.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
closable | boolean | — | Show a close button (also closes with Delete). |
disabled | boolean | — | Skipped by keyboard and not selectable. |
count | number | — | Count badge after the label (unread, results); hidden at 0 unless show-zero. |
max | number | — | Highest count shown before "+" (default 99). |
show-zeroprop: showZero | boolean | — | Keep the count badge at 0. |
count-labelprop: countLabel | string | — | What the count means for screen readers; {count} is filled in ("{count} unread"). |
Slots
| Slot | Description |
|---|---|
(default) | Tab label (add an icon or a pm-badge for counts). |
<pm-tab-panel>
Panel for the pm-tab at the same index. Hidden with hidden=until-found when supported.
Slots
| Slot | Description |
|---|---|
(default) | Panel content. |
Used in templates
Customer 360Team and rolesUser profileAccount settingsProduct page