Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

SliderTrack

  • Stable
  • WCAG 2.2 evidence
  • RTL

The track of a slider: rail, fill, optional step ticks and one thumb per value, with the value bubble shown while a thumb is dragged. Figma's Value (0 to 100) and State variants are renderings of the slider's state, not props. Slider renders it for you; render it yourself only inside a React Aria Slider. Built on React Aria SliderTrack, SliderFill and SliderThumb: each thumb is a focusable range input with aria-valuenow and a localised aria-valuetext; arrows, Page Up / Page Down and Home / End move it, and pressing the track moves the nearest thumb there, so dragging is never required (WCAG 2.1.1, 2.5.7, 4.1.2). The thumb has a 24 px pointer target (2.5.8). Horizontal only; RTL reverses the direction.

import { SliderTrack } from "@nexera-ui/react";
Loading example…
3
examples
5
props
1
live controls
1
platform
9
WCAG criteria
0
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
ticks
Generated code
import { SliderTrack } from "@nexera-ui/react";

<SliderTrack />

Examples 2

The same examples as Storybook, rendered live. Open Code to copy one.

With ticks

Show ticks: a dot at every step (here step={10}).

Loading example…

Right to left

Right-to-left: the fill and the ticks start on the right.

Loading example…

Props 5

Press "Try it" on a card to load that prop into the playground.

5 props shown

ticksNexera
boolean

Draw a dot at every step of the slider. Decorative. Drawn only when the range has at most 51 steps.

Default false
thumbLabelsNexera
readonly string[]

Accessible names of the thumbs when there are two or more (a range), for example ["Minimum salary", "Maximum salary"]. A single thumb is named by the slider's label. Translate them.

Default ["Minimum", "Maximum"] as const
nameNexera
string

Form field name of every thumb's hidden range input (a range submits two values under the same name).

Default –
classNameNexera
string

Extra classes for the track, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style for the track.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

5 direct · 4 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.3.2Meaningful SequenceLevel A · supporting test
  • 1.4.11Non-text ContrastLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.7Focus VisibleLevel AA · supporting test
  • 2.5.7Dragging MovementsLevel AA · tested directly
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

  • data-disabled
  • data-dragging
  • data-hovered
Usage
<SliderTrack className="data-disabled:opacity-90 shadow-sm" />

Used in blocks

No block uses SliderTrack yet.

Related components