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

Slider <pm-slider>

Range slider. marks adds labelled ticks (clickable, and snapped to by the native control); unit and locale format the shown value and what screen readers hear (aria-valuetext).

Full screen

Props

<script type="module"> import '@prismora/css'; import '@prismora/elements/slider'; </script> <pm-slider label="Volume" min="0" max="100" value="40" unit="%" show-value></pm-slider> <pm-slider label="T-shirt size" min="0" max="4" value="2" show-value marks='[{"value":0,"label":"XS"},{"value":1,"label":"S"},{"value":2,"label":"M"},{"value":3,"label":"L"},{"value":4,"label":"XL"}]'></pm-slider>

Sizes

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

size="xs"
size="sm"
size="md"
size="lg"
size="xl"

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.

Disabled
Read-only
Required
Error
With a hint

Attributes

AttributeTypeDefaultDescription
minnumber0Lowest allowed value.
maxnumber100Highest allowed value.
stepnumber1Increment between allowed values.
show-value
prop: showValue
booleanfalseShow the current value next to the control.
marks(number | { value: number; label?: string })[]—Ticks: numbers or { value, label }.
unitstring—Unit after the value, e.g. "%", "px", "kg".
localestring—Locale for number formatting.
namestring—Form field name: the value is submitted under it.
valuestring—Current value (submitted with the form).
labelstring—Visible label (required for accessibility; use hide-label to visually hide it).
hintstring—Help text under the field, linked to it for screen readers.
errorstring—Custom error message. Setting it marks the control invalid.
size'xs' | 'sm' | 'md' | 'lg' | 'xl'—Control size.
requiredbooleanfalseThe form cannot be submitted until this has a value.
disabledbooleanfalseNot interactive and not submitted.
readonlybooleanfalseFocusable and submitted, but not editable.
hide-label
prop: hideLabel
booleanfalseHide the label visually; it stays the accessible name.

Also accepts the contextual attributes tone, surface, radius, density, motion, elevation. They are inherited from ancestors' data-* attributes.

Events

EventReact / Svelte propDescription
pm-inputonPmInputOn every value change while editing.
pm-changeonPmChangeWhen the value is committed.

Methods

checkValidity(), reportValidity(), validate(), focus()

Used in templates

Pricing plans