Tessera UI

Slider

A range input control built on Base UI. Two visual variants (discrete and continuous), five intents, three sizes, horizontal and vertical orientation, range mode, tick marks, value tooltip, and RTL support.

Installation

pnpm add @tessinaui/ui

Usage

import { Slider } from "@tessinaui/ui";

<Slider defaultValue={40} />

Playground

Preview

Showcase

Preview

Variants

VariantDescription
discreteClassic thin-track slider with a pill-shaped thumb. Default.
continuousLarge capsule/pill fill-style slider with a circular knob inside.

Intents

IntentColor tokenUse case
nonebg-primaryDefault brand color
errorbg-errorError or danger state
warningbg-warningWarning or caution state
successbg-successSuccess or confirmation state
infobg-infoInformational state

Props

PropTypeDefaultDescription
valuenumber | readonly number[]Controlled value. Pass an array for range mode.
defaultValuenumber | readonly number[]40Initial uncontrolled value. Pass an array for range mode.
minnumber0Minimum allowed value
maxnumber100Maximum allowed value
stepnumber1Step increment
largeStepnumberStep for Page Up/Down or Shift+Arrow
onValueChange(value: number | readonly number[]) => voidFires on every change
onValueCommitted(value: number | readonly number[]) => voidFires on pointer up / key up
variant"discrete" | "continuous""discrete"Visual style
size"sm" | "md" | "lg""md"Scale
intent"none" | "error" | "warning" | "success" | "info""none"Semantic color intent
orientation"horizontal" | "vertical""horizontal"Layout direction
disabledbooleanfalseDisable all interaction
rounded"none" | "sm" | "md" | "lg" | "xl" | "full""full"Border radius of track, indicator, and thumb
marksboolean | SliderMark[]falsetrue = auto-generate at every step (capped at 50). Array = custom positions with optional labels.
minLabelReactNodeLabel at the min end (left for horizontal, bottom for vertical)
maxLabelReactNodeLabel at the max end (right for horizontal, top for vertical)
showValuebooleanfalseShow current value as a floating tooltip above/beside the thumb
labelReactNodeAccessible label (rendered sr-only)
leadingIconReactNodeIcon at the leading end (left for horizontal, bottom for vertical)
trailingIconReactNodeIcon at the trailing end (right for horizontal, top for vertical)
getAriaLabel(index: number) => stringAccessible label per thumb (range mode)
getAriaValueText(formatted, value, index) => stringAccessible value text per thumb
namestringForm field name
formatIntl.NumberFormatOptionsNumber format for the value tooltip
dir"ltr" | "rtl""ltr"Text direction
classNamestringExtra classes on the root element

SliderMark

FieldTypeDescription
valuenumberValue at which to render the tick dot
labelReactNodeOptional text label beside the dot

Range Slider

Pass an array to defaultValue or value to enable range (two-thumb) mode:

<Slider defaultValue={[20, 80]} />

Accessibility

  • Built on Base UI's Slider primitive — keyboard navigation (Arrow keys, Page Up/Down, Home, End) is handled automatically.
  • Each thumb renders an <input type="range"> with a proper accessible role.
  • Use getAriaLabel in range mode to provide distinct labels for each thumb (e.g. "Minimum price", "Maximum price").
  • Tick mark labels are aria-hidden — they are visual decorations; use getAriaValueText for screen-reader value descriptions.
  • Focus ring: has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-offset-2 scoped to the thumb container.
  • All interactive areas meet the WCAG AA 44×44 px minimum touch target.

On this page