40+ landing page components for ReactBrowse now

Primitives

Slider

Range slider for selecting a numeric value within a min/max range. Supports multiple sizes, colors, and keyboard interaction.

Installation

npm install @trinkui/react

Import

import { Slider } from "@trinkui/react";

Sizes

Small30
Medium50
Large70

Colors

Primary
Secondary
Success
Warning
Danger

Disabled

Disabled

Props

PropTypeDefaultDescription
value
numberControlled value of the slider
defaultValue
number0Initial uncontrolled value
onChange
(value: number) => voidCallback when value changes
min
number0Minimum value
max
number100Maximum value
step
number1Step increment
label
stringLabel text above the slider
showValue
booleanfalseDisplay current value alongside the label
size
"sm" | "md" | "lg""md"Track and thumb size
color
"primary" | "secondary" | "success" | "warning" | "danger""primary"Color theme of the filled track and thumb
disabled
booleanfalseDisable interaction
className
stringAdditional CSS classes

Accessibility

  • Uses role="slider" on the track element.
  • Exposes aria-valuenow, aria-valuemin, and aria-valuemax.
  • Arrow keys (left/right and up/down) adjust the value by one step.
  • Home/End keys jump to the min/max value.
  • Thumb is focusable with a visible focus-visible ring.