SliderField

Form & Input
stable

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.

Anatomy of OrigamSliderFieldSchematic of the SliderField component with 5 numbered internal parts. Volume 1 2 3 4 5 origam-slider-field
Anatomy of <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.

disabled
boolean
false
Disables the slider. Sets aria-disabled and prevents interaction.
required
boolean
label
string
Field label rendered in the form chrome (field variant only).
error
boolean
false
Forces the error visual state. The track fill turns to the danger intent color.
readonly
boolean
false
Makes the slider non-interactive without visually disabling it.
max
number | string
100
Maximum allowed value.
min
number | string
0
Minimum allowed value.
step
number | string
0
Increment step. 0 = continuous.
trackProps
ISliderFieldTrackProps
reverse
boolean
false
Reverses the track direction (fill runs from end to start).
modelValue
number | string | Array<number> | Array<string>
Current slider value. Use an array for range (dual-thumb) mode.
range
boolean
false
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.
ticks
Array<number> | Record<string, string>
tickSize
TSize | number
inset
boolean
false
Compact inset style — thumb sits inside the track (smaller, no overflow).
variant
'field'
Visual variant. 'field' = full form chrome (label, messages), 'timer' = bare scrubber, 'audio' = waveform scrubber.
buffered
number
Secondary fill from min to buffered (e.g. video loaded range), at reduced opacity.
showThumbOnHoverOnly
boolean
false
Hides the thumb at rest; reveals it on container hover, focus-within or during drag (CSS-only).
showHoverTooltip
boolean
false
Shows a floating tooltip above the rail with the value at the cursor position.
formatHoverTooltip
(value: number) => string
peaks
ReadonlyArray<number>
Waveform peaks [0–1] painted as vertical bars in audio variant mode.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
density
'default'
Adjusts vertical padding density.
color
Thumb and fill color. Accepts semantic intents or CSS color.
centerAffix
boolean
hideDetails
boolean | string
hideSpinButtons
boolean
hint
string
persistentHint
boolean
messages
Array<string> | string
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
rounded
boolean | number | string | TRounded | null | undefined
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
bgColor
TColor
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
elevation
TElevation
height
number | string
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
direction
'horizontal'
Slider orientation: horizontal (default) or vertical.
errorMessages
Array<string> | string
maxErrors
number | string
name
string
rules
Array<any>
validateOn
TValidateOn
validationValue
any
focused
boolean
appendAvatar
string
appendIcon
TIcon
prependAvatar
string
prependIcon
TIcon
prependAriaLabel
string
appendAriaLabel
string
size
TSize | number
fontSize
TFontSize
fontWeight
TFontWeight
lineHeight
TLineHeight
ripple
boolean | { 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.

@start
number | string | Array<number> | Array<string>
Fired on pointerdown of a thumb (drag start).
@end
number | string | Array<number> | Array<string>
Fired on pointerup (drag end).
@update:modelValue
any
Emitted on every value change during drag.
@update:focused
any
@focus
FocusEvent
Fired when the slider thumb receives focus.
@blur
FocusEvent
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

slider

Keyboard interactions

Keyboard interactions
KeyAction
Arrow Left / DownDecreases the value by one step.
Arrow Right / UpIncreases the value by one step.
HomeJumps to the minimum value.
EndJumps to the maximum value.
Page Up / Page DownIncrements 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.

Source
dimension
4px
Track rail height.
color
var(--origam-color__surface---disabled)
Unfilled rail color.
dimension
16px
Thumb diameter.
color
var(--origam-color__action--primary---bg)
Thumb background.
number
1.25
Thumb scale on hover.
number
var(--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

vue

Range (dual thumb)

vue

With ticks

vue

Ecosystem

Family

Components from the same folder that share conventions and often compose together.