Fine-tune light, shadows, borders, neumorphic
Light and shadows
Borders
Neumorphic
Forms Form-associated

Segmented <pm-segmented>

Segmented control: pick one of a few options (view switchers, filters). Radio-group semantics, form-associated.

Full screen
List Board Calendar

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/segmented'; </script> <pm-segmented label="View" value="board"> <pm-segment value="list">List</pm-segment> <pm-segment value="board">Board</pm-segment> <pm-segment value="calendar">Calendar</pm-segment> </pm-segmented>

Sizes

Set with the size attribute; controls keep touch-sized targets on phones.

List Board Calendar
size="sm"
List Board Calendar
size="md"
List Board Calendar
size="lg"

Tones

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

List Board Calendar
tone="accent"
List Board Calendar
tone="secondary"
List Board Calendar
tone="neutral"
List Board Calendar
tone="success"
List Board Calendar
tone="warning"
List Board Calendar
tone="danger"
List Board Calendar
tone="info"

States

Each state is one attribute.

List Board Calendar
Disabled
List Board Calendar
Read-only
List Board Calendar
Required
List Board Calendar
Error
List Board Calendar
With a hint

Attributes

AttributeTypeDefaultDescription
hintstring—Help text under the field, linked to it for screen readers.
errorstring—Custom error message. Setting it marks the field invalid.
requiredbooleanfalseThe form cannot be submitted until a value is chosen.
valuestring—Value of the chosen segment (the first enabled one when unset).
namestring—Form field name: the value is submitted under it.
labelstring—Accessible name of the group.
size'sm' | 'md' | 'lg'—Control size.
fullbooleanfalseStretch to the container width.
disabledbooleanfalseNot interactive and not submitted.
readonlybooleanfalseFocusable 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

EventReact / Svelte propDescription
pm-changeonPmChangeSelection changed.

Slots

SlotDescription
(default)pm-segment elements.

Methods

checkValidity(), reportValidity(), validate()

<pm-segment>

One option of a segmented control.

Attributes

AttributeTypeDefaultDescription
valuestring—Current value.
disabledbooleanfalseNot interactive (and not submitted, for form controls).
labelstring—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

SlotDescription
(default)Label (text and/or icon).

Used in templates

Overview dashboardTraffic analyticsOrdersCustomer 360InboxNotificationsProject boardBilling and invoicesUser profileAccount settingsCreate accountPricing plansProduct pageChangelogComing soonOnboarding wizard