$ rezi
Widgets

Slider

A focusable range input for numeric values.

A focusable range input for numeric values.

Usage

import { ui } from "@rezi-ui/core";

ui.slider({
  id: "volume",
  value: state.volume,
  min: 0,
  max: 100,
  step: 5,
  onChange: (value) => app.update((s) => ({ ...s, volume: value })),
});

Props

PropTypeDefaultDescription
idstringrequiredUnique identifier for focus and routing
valuenumberrequiredCurrent value
minnumber0Minimum value
maxnumber100Maximum value
stepnumber1Keyboard increment/decrement step
widthnumberautoTrack width in cells
labelstring-Optional label before the slider
showValuebooleantrueShow numeric value text
onChange(value: number) => void-Called when value changes
disabledbooleanfalseDisable focus and interaction
readOnlybooleanfalseKeep focusable, but block value changes
styleTextStyle-Optional style override
keystring-Reconciliation key

Behavior

  • Focusable when enabled.
  • Left/Down decreases by step.
  • Right/Up increases by step.
  • PageDown/PageUp changes by 10 steps.
  • Home/End jumps to min/max.
  • readOnly sliders still receive focus but do not emit onChange.
  • Input - Free-form text input
  • Select - Discrete option selection
  • Field - Labels, hints, and error display

On this page