SliderField
Range slider with thumb, track and tick marks. Supports range (dual-thumb), vertical orientation, and media-scrubber variants.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #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
Événements émis par ce composant.
- @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
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- <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.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Interactions clavier
| Touche | 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.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- 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.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic slider
Range (dual thumb)
With ticks
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.