SliderField
Range slider with thumb, track and tick marks. Supports range (dual-thumb), vertical orientation, and media-scrubber variants.
Structure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-slider-field> — 5 internal parts: root ①, label ②, track-fill ③, thumb ④ and tick marks ⑤.- 1.origam-slider-field
- Root container. Wraps inside OrigamInput chrome when variant="field".
- 2.origam-slider-field__label
- Label slot area. Rendered only in field variant.
- 3.origam-slider-field__fill
- Active fill bar. Width/height proportional to modelValue between min and max.
- 4.origam-slider-field__thumb
- Draggable thumb. Scales on hover/active. Hides at rest when showThumbOnHoverOnly=true.
- 5.origam-slider-field__tick
- Tick mark dots shown when showTicks is set. One dot per step increment.
API
Props
All props accepted by this component, with their type, default value and description.
- disabledbooleanfalse
- Disables the slider. Sets aria-disabled and prevents interaction.
- requiredboolean
- labelstring
- Field label rendered in the form chrome (field variant only).
- errorbooleanfalse
- Forces the error visual state. The track fill turns to the danger intent color.
- readonlybooleanfalse
- Makes the slider non-interactive without visually disabling it.
- maxnumber | string100
- Maximum allowed value.
- minnumber | string0
- Minimum allowed value.
- stepnumber | string0
- Increment step. 0 = continuous.
- trackPropsISliderFieldTrackProps
- reversebooleanfalse
- Reverses the track direction (fill runs from end to start).
- modelValuenumber | string | Array<number> | Array<string>
- Current slider value. Use an array for range (dual-thumb) mode.
- rangebooleanfalse
- Enables dual-thumb range selection. modelValue must be an array of two values.
- showTicks
- When set, tick marks are shown. Pass 'always' to show them at all times.
- ticksArray<number> | Record<string, string>
- tickSizeTSize | number
- insetbooleanfalse
- Compact inset style — thumb sits inside the track (smaller, no overflow).
- Visual variant. 'field' = full form chrome (label, messages), 'timer' = bare scrubber, 'audio' = waveform scrubber.
- bufferednumber
- Secondary fill from min to buffered (e.g. video loaded range), at reduced opacity.
- showThumbOnHoverOnlybooleanfalse
- Hides the thumb at rest; reveals it on container hover, focus-within or during drag (CSS-only).
- showHoverTooltipbooleanfalse
- Shows a floating tooltip above the rail with the value at the cursor position.
- formatHoverTooltip(value: number) => string
- peaksReadonlyArray<number>
- Waveform peaks [0–1] painted as vertical bars in audio variant mode.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- Adjusts vertical padding density.
- color
- Thumb and fill color. Accepts semantic intents or CSS color.
- centerAffixboolean
- hideDetailsboolean | string
- hideSpinButtonsboolean
- hintstring
- persistentHintboolean
- messagesArray<string> | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- bgColorTColor
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- elevationTElevation
- heightnumber | string
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- Slider orientation: horizontal (default) or vertical.
- errorMessagesArray<string> | string
- maxErrorsnumber | string
- namestring
- rulesArray<any>
- validateOnTValidateOn
- validationValueany
- focusedboolean
- appendAvatarstring
- appendIconTIcon
- prependAvatarstring
- prependIconTIcon
- prependAriaLabelstring
- appendAriaLabelstring
- sizeTSize | number
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
- rippleboolean | { class: string }
API
Slots
Content slots exposed by this component.
- #default
- #label
- Replaces the label element in field variant.
- #item
- #details
- #messages
- #message
- #prepend
- Content placed before the slider track (outside the field chrome).
- #append
- Content placed after the slider track (outside the field chrome).
API
Emits
Events emitted by this component.
- @startnumber | string | Array<number> | Array<string>
- Fired on pointerdown of a thumb (drag start).
- @endnumber | string | Array<number> | Array<string>
- Fired on pointerup (drag end).
- @update:modelValueany
- Emitted on every value change during drag.
- @update:focusedany
- @focusFocusEvent
- Fired when the slider thumb receives focus.
- @blurFocusEvent
- Fired when the slider thumb loses focus.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to a child component.
- Ref<string>
- Reactive CSS string generated by useStyle.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet into the document.
- () => void
- Removes the injected style sheet.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Transition duration for thumb scale and fill width animations.
- Track rail height (horizontal orientation).
- Unfilled track rail background color.
- Active fill color. Overridden by color prop.
- Thumb diameter.
- Thumb background color.
- Thumb scale on hover.
- Opacity when disabled.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Arrow Left / Down | Decreases the value by one step. |
| Arrow Right / Up | Increases the value by one step. |
| Home | Jumps to the minimum value. |
| End | Jumps to the maximum value. |
| Page Up / Page Down | Increments or decrements by 10% of the total range. |
Notes
- The native <input type="range"> owns keyboard and pointer math. aria-valuemin, aria-valuemax, aria-valuenow and aria-orientation are managed by the browser natively.
- Pair with the label prop or an aria-label attribute to identify the slider purpose for screen readers.
- In range (dual-thumb) mode, each thumb is a separate <input type="range">. Provide distinct aria-label values for the start and end thumbs.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- dimension4px
- Track rail height.
- colorvar(--origam-color__surface---disabled)
- Unfilled rail color.
- dimension16px
- Thumb diameter.
- colorvar(--origam-color__action--primary---bg)
- Thumb background.
- number1.25
- Thumb scale on hover.
- numbervar(--origam-opacity---32)
- Opacity when disabled.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic slider
Range (dual thumb)
With ticks
Ecosystem
Family
Components from the same folder that share conventions and often compose together.