Skip to content

Slider

Slider

Category: Forms & inputs

<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: @helix-ui/core

import { Slider } from '@helix-ui/core';

status: stable · since: 0.2.0

Tags: range, value, horizontal

Anatomy

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

Layout

  • display — block
  • width — fill
  • height — content
  • intrinsicSize — fills width, ~32px tall
  • stackable — true
  • fullBleed — false

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
labelReactNode—Visible 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.NumberFormatOptions—Format the rendered output (percent, currency, units).
onChange(value) => void—Change 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 helix-ui 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} />