SliderFieldTrack
Internal track sub-component of SliderField. Renders the background rail, the fill bar and optional tick marks. Not intended for standalone use.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-slider-field-track> — 4 layers: root rail ①, background bar ②, fill bar ③ and tick marks ④.- 1.origam-slider-field-track
- Root element. Position: relative, border-radius: 9999px, pointer-events: none. Size set via --origam-slider-field-track---size.
- 2.origam-slider-field-track__background
- Rail background bar. Spans 100% in the track axis. Opacity 0.38 when a fill color is active (--opacity modifier). Animated via slider-field__track---transition.
- 3.origam-slider-field-track__fill
- Fill bar. Positioned from start% to stop% along the track axis using logical CSS properties.
- 4.origam-slider-field-track__ticks
- Tick container. Rendered only when showTicks is truthy and parsedTicks is non-empty. Children are .origam-slider-field-track__tick elements.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- startnumber0
- Fill bar start position as a percentage (0–100). Provided by the parent SliderField.
- stopnumber100
- Fill bar end position as a percentage (0–100). Provided by the parent SliderField.
- disabledbooleanfalse
- When true, color channels are set to undefined so the track renders in its disabled visual state (driven by the parent).
- errorbooleanfalse
- Forces both color channels to "danger". Driven by the parent slider error flag.
- minnumber0
- Minimum boundary — used to suppress the first/last tick marks.
- maxnumber100
- Maximum boundary — used to suppress the first/last tick marks.
- isVerticalbooleanfalse
- When true, switches logical CSS axis from inline to block (vertical orientation).
- indexFromEndbooleanfalse
- Inverts the start direction. Used when reverse=true or isVertical=true.
- Controls tick visibility. false = hidden, true = visible on hover/focus, "always" = always visible.
- tickSizenumber | string2
- Tick dot size in pixels. Sets --origam-slider-field-track__tick---size.
- ticks
- Pre-computed tick descriptor array. Parent SliderField owns the math and passes the result down.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- color
- Fill bar color. When error=true, overridden with "danger".
- bgColor
- Rail (background) color. When error=true, overridden with "danger".
- sizeTSize | number4
- Track thickness in pixels. Sets --origam-slider-field-track---size.
- Border-radius token applied to the track root and its background/fill children.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
API
Slots
Emplacements de contenu exposés par ce composant.
- #item
- Custom label for every tick mark. Receives the TTick descriptor and its index.
- #item.{index}
- Per-index tick label slot. Takes precedence over the generic item slot for that specific index.
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>
- Forwards a filtered subset of props to child components.
- Ref<string>
- Reactive CSS string generated by useStyle from computed track styles.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet. Called automatically on mount.
- () => void
- Removes the injected style sheet. Called automatically on unmount.
- Ref<boolean>
- True once the style sheet has been injected.
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.
- Track thickness. Set inline from the size prop. Default: 4 px.
- Tick dot size. Set inline from the tickSize prop. Default: 2 px.
- Transition applied to the background and fill bars. Driven by slider-field token slider-field.transition-duration.
Inclusion
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Notes
- pointer-events: none is set on the root so the track never intercepts thumb interactions. All keyboard and pointer handling lives in the parent SliderField.
- Under forced-colors (Windows High Contrast): the root receives a thin solid buttontext border, and background/fill use the highlight system color.
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
- Default track height / thickness.
- colorvar(--origam-color__surface---disabled)
- Rail background color.
- dimensionvar(--origam-radius---full)
- Border radius of the track (pill shape).
- dimension4px
- Tick dot size token.
- colorvar(--origam-color__text---disabled)
- Tick dot color in the unfilled zone.
- colorvar(--origam-color__action--primary---fg)
- Tick dot color in the filled zone.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Sous-partie interne : elle est injectée par son composant parent et ne peut pas se rendre seule. Voir la fiche du composant parent pour un exemple vivant.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Usage note
Écosystème
Famille
Composants du même dossier qui partagent les conventions et se composent souvent ensemble.