Skip to main content

Slider

Interactive

See Slider in Storybook for every variant, with live controls.

A range input with a mono readout. For a value that must be exact, use Input type="number" instead.

import { Slider } from "@kairosis/eidos";

<Slider label="CPU limit" unit="%" value={cpu} onChange={setCpu} />;

Props

PropTypeDefaultDescription
valuenumberRequired. Controlled
onChange(value: number) => voidReceives a number, already coerced
labelstring
min / maxnumber0 / 100
stepnumber1
showValuebooleantrueMono readout above the track
unitstring""Suffix for the readout, e.g. "%"
disabledbooleanfalse

Forwards a ref to the underlying <input type="range">.

Guidelines

  • A real range input sits transparent on top of the painted rail, so it keeps native keyboard and pointer behaviour.
  • The filled portion is driven by a --slider-fill custom property, not by re-rendering the track.
  • Use unit rather than baking the symbol into the label — the readout is the value, the label is the name.