Slider

Headless single-thumb slider primitives for Roblox UI.

Experimental / feature-limited
@lattice-ui/slider

currently single-thumb only

What It Is For

Use Slider for bounded numeric input when dragging or key-based adjustment is more natural than typing a raw number.

It is a headless primitive for one-dimensional range selection rather than a styled media scrubber.

Preview size

Live demo is experimental and may contain bugs.

Install

Global CLI command: lattice add slider

Monorepo local script

Use your package manager wrapper when running the local lattice command.

pnpm lattice add slider

npm package: @lattice-ui/slider

Peer dependencies

  • @rbxts/react
  • @rbxts/react-roblox

Public Exports

  • Slider
  • Slider.Root
  • Slider.Track
  • Slider.Range
  • Slider.Thumb

State Model

  • Slider.Root manages controlled or uncontrolled numeric value plus a separate commit callback for final confirmation.
  • min, max, step, orientation, and disabled define how movement maps to values.
  • Track and thumb hosts are registered into shared slider state so drag calculations know which geometry to use.

Key API

Slider.Root

Use value, defaultValue, onValueChange, onValueCommit, min, max, step, and orientation to define the numeric model.

Slider.Track

Bind your main drag surface here so the slider can translate pointer position into values.

Slider.Range / Slider.Thumb

Use these for the filled segment and the draggable handle without reimplementing range math.

Composition Patterns

Audio or gameplay settings

Use a horizontal slider with a separate numeric label when the user benefits from both direct manipulation and explicit value feedback.

Vertical scrubbing surfaces

Use orientation="vertical" for compact inspector-style controls or side-mounted adjustment strips.

Cautions / Limits

  • The current public package is single-thumb only; it is not a dual-handle range selector.
  • Values are clamped and stepped by the package, so do not depend on raw pointer positions as authoritative state.
  • Use motion for thumb and range response; slider state should stay value-driven rather than animation-driven.