Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Navigation

Tabs <pm-tabs>

Tabs that switch between panels of related content, with keyboard support, overflow scrolling and closable tabs.

Full screen
Profile Billing Security Audit log Draft: Q3 plan Your public profile. Invoices and payment methods. Passkeys and sessions. Available on the Business plan. Close this tab with its ✕ or the Delete key.

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/tabs'; </script> <pm-tabs label="Account"> <pm-tab>Profile</pm-tab> <pm-tab count="3" count-label="{count} unpaid invoices">Billing</pm-tab> <pm-tab>Security</pm-tab> <pm-tab disabled>Audit log</pm-tab> <pm-tab closable>Draft: Q3 plan</pm-tab> <pm-tab-panel>Your public profile.</pm-tab-panel> <pm-tab-panel>Invoices and payment methods.</pm-tab-panel> <pm-tab-panel>Passkeys and sessions.</pm-tab-panel> <pm-tab-panel>Available on the Business plan.</pm-tab-panel> <pm-tab-panel>Close this tab with its ✕ or the Delete key.</pm-tab-panel> </pm-tabs>

Variants

Set with the variant attribute.

Profile Billing Security Audit log Draft: Q3 plan Your public profile. Invoices and payment methods. Passkeys and sessions. Available on the Business plan. Close this tab with its ✕ or the Delete key.
variant="line"
Profile Billing Security Audit log Draft: Q3 plan Your public profile. Invoices and payment methods. Passkeys and sessions. Available on the Business plan. Close this tab with its ✕ or the Delete key.
variant="pills"

Tones

Set tone on the element, or data-tone on any ancestor to tone a whole area.

Profile Billing Security Audit log Draft: Q3 plan Your public profile. Invoices and payment methods. Passkeys and sessions. Available on the Business plan. Close this tab with its ✕ or the Delete key.
tone="accent"
Profile Billing Security Audit log Draft: Q3 plan Your public profile. Invoices and payment methods. Passkeys and sessions. Available on the Business plan. Close this tab with its ✕ or the Delete key.
tone="secondary"
Profile Billing Security Audit log Draft: Q3 plan Your public profile. Invoices and payment methods. Passkeys and sessions. Available on the Business plan. Close this tab with its ✕ or the Delete key.
tone="neutral"
Profile Billing Security Audit log Draft: Q3 plan Your public profile. Invoices and payment methods. Passkeys and sessions. Available on the Business plan. Close this tab with its ✕ or the Delete key.
tone="success"
Profile Billing Security Audit log Draft: Q3 plan Your public profile. Invoices and payment methods. Passkeys and sessions. Available on the Business plan. Close this tab with its ✕ or the Delete key.
tone="warning"
Profile Billing Security Audit log Draft: Q3 plan Your public profile. Invoices and payment methods. Passkeys and sessions. Available on the Business plan. Close this tab with its ✕ or the Delete key.
tone="danger"
Profile Billing Security Audit log Draft: Q3 plan Your public profile. Invoices and payment methods. Passkeys and sessions. Available on the Business plan. Close this tab with its ✕ or the Delete key.
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

AttributeTypeDefaultDescription
selectednumber0Whether this item is selected.
labelstring—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

EventReact / Svelte propDescription
pm-changeonPmChangeAnother tab was selected.
pm-closeonPmCloseA 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

AttributeTypeDefaultDescription
closableboolean—Show a close button (also closes with Delete).
disabledboolean—Skipped by keyboard and not selectable.
countnumber—Count badge after the label (unread, results); hidden at 0 unless show-zero.
maxnumber—Highest count shown before "+" (default 99).
show-zero
prop: showZero
boolean—Keep the count badge at 0.
count-label
prop: countLabel
string—What the count means for screen readers; {count} is filled in ("{count} unread").

Slots

SlotDescription
(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

SlotDescription
(default)Panel content.

Used in templates

Customer 360Team and rolesUser profileAccount settingsProduct page