Skip to content

Slider

Slider

<Slider label="Volume" defaultValue={70} formatOptions={{ style: 'percent' }} maxValue={100} />
{/* Range slider */}
<Slider label="Budget" defaultValue={[40, 80]} formatOptions={{ style: 'currency', currency: 'USD' }} maxValue={500} step={5} />

Install: @helixui/core

import { Slider } from '@helixui/core'

status: stable · since: 0.2.0

Tags: range, value, horizontal

Anatomy

─────────●───────────────── single thumb
─────●═══════════●───────── range (two thumbs)

Layout

  • displayblock
  • widthfill
  • heightcontent
  • intrinsicSizefills width, ~32px tall
  • stackabletrue
  • fullBleedfalse

Visual

A horizontal track with a brand-filled portion under the thumb(s). Single thumb for one value; two thumbs for a range. Optional ticks and labels.

Props

NameTypeDefaultDescription
labelReactNodeVisible label.
showValuebooleantrueRender the formatted current value to the right of the label.
valuenumber | number[]Controlled value(s).
defaultValuenumber | number[]Uncontrolled initial value(s).
minValuenumber0Min.
maxValuenumber100Max.
stepnumber1Step.
formatOptionsIntl.NumberFormatOptionsFormat the rendered output (percent, currency, units).
onChange(value) => voidChange handler.

Tokens used

color.bg.surface.default, color.bg.action.neutral.default, color.bg.action.brand.default, color.text.primary, color.text.secondary, color.text.muted, color.border.focus, radius.full, space.2, font.family.sans, font.size.sm, font.weight.medium, shadow.sm

Accessibility

Keyboard

KeyAction
ArrowKeysStep value.
PageUpBig step up.
PageDownBig step down.
HomeMin.
EndMax.

Composes with

ComponentRelationNote
FormparentSubmitted as part of a Form.
FieldwrapsHas built-in label/description.
NumberFieldsibling

Prompt examples

These are the AI prompt → JSX mappings used by the helixui prompt DSL and integrations like Cursor / Claude Code.

volume control

“slider 0 to 100”

<Slider label="Volume" value={vol} onChange={setVol} minValue={0} maxValue={100} />

price range

“range slider for min/max price”

<Slider label="Price" value={range} onChange={setRange} minValue={0} maxValue={500} />