Segmented <pm-segmented>
Segmented control: pick one of a few options (view switchers, filters). Radio-group semantics, form-associated.
Sizes
Set with the size attribute; controls keep touch-sized targets on phones.
size="sm"size="md"size="lg"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"States
Each state is one attribute.
DisabledRead-onlyRequiredErrorWith a hintAttributes
| Attribute | Type | Default | Description |
|---|---|---|---|
hint | string | — | Help text under the field, linked to it for screen readers. |
error | string | — | Custom error message. Setting it marks the field invalid. |
required | boolean | false | The form cannot be submitted until a value is chosen. |
value | string | — | Value of the chosen segment (the first enabled one when unset). |
name | string | — | Form field name: the value is submitted under it. |
label | string | — | Accessible name of the group. |
size | 'sm' | 'md' | 'lg' | — | Control size. |
full | boolean | false | Stretch to the container width. |
disabled | boolean | false | Not interactive and not submitted. |
readonly | boolean | false | Focusable and submitted, but the user cannot change the value. |
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 | Selection changed. |
Slots
| Slot | Description |
|---|---|
(default) | pm-segment elements. |
Methods
checkValidity(), reportValidity(), validate()
<pm-segment>
One option of a segmented control.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
value | string | — | Current value. |
disabled | boolean | false | Not interactive (and not submitted, for form controls). |
label | string | — | Accessible name for icon-only segments. |
Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.
Slots
| Slot | Description |
|---|---|
(default) | Label (text and/or icon). |
Used in templates
Overview dashboardTraffic analyticsOrdersCustomer 360InboxNotificationsProject boardBilling and invoicesUser profileAccount settingsCreate accountPricing plansProduct pageChangelogComing soonOnboarding wizard