ProductBrand
Join us
Foundations
  • Introduction
  • Colors
  • Typography
  • Icons
  • Illustrations
  • Logos
  • Shadows
Components
  • Accordion
  • Alert Dialog
  • Avatar
  • Badge
  • Button
  • Calendar
  • Card
  • Chart
  • Checkbox
  • Collapsible
  • Combobox
  • Context Menu
  • Date Picker
  • Dialog
  • Drawer
  • Dropdown Menu
  • Fluid Avatar
  • Hover Scroll Text
  • Input
  • Kbd
  • Popover
  • Progress Bar
  • Radio Group
  • Scroll Area
  • Select
  • Selectors
  • Separator
  • Separator Dot
  • Shimmer Text
  • Skeleton
  • Slider
  • Switch
  • Tabs
  • Textarea
  • Toast
  • Tooltip
Compositions
  • Empty State
  • File Attachment
  • Floating Bar
  • Input Banner
  • Markdown Editor
  • Media Controls
  • Product Feature Banner
  • Panels
  • Sidebar
  • Reasoning Trace
  • Pagination
  • Data Table
  • Breadcrumb
  • Thread Outline
Inline
  • Overview
  • Stat Tile
  • Metric Row
  • Comparison Table
  • Chart Card
  • Trend Tile
  • Cite
  • Custom
  • Agent skill

Slider

A control that lets users select a numeric value from a range by dragging a thumb along a track.

Examples

65%

Custom format

72°F

Steps

50%

Range

$25 - $75

Custom composition

60%

Controlled

50

Overview

Slider lets users pick a numeric value within a range. It supports labels, live readout, custom formatting, range selection (two thumbs), and three sizes. Built on Base UI Slider.

tsx
import { Slider } from "@rogo-technologies/ui/slider";

<Slider defaultValue={50} label="Volume" showValue />;

Usage

Sizes

SizeTrack heightThumbUse case
sm4px14pxCompact controls, settings panels
md6px16pxDefault: forms, dialogs
lg8px20pxProminent controls, hero sections
tsx
<Slider defaultValue={30} size="sm" label="Small" showValue />
<Slider defaultValue={70} size="lg" label="Large" showValue />

Custom format

tsx
<Slider defaultValue={72} label="Temperature" showValue formatValue={(v) => `${v}°F`} />

Steps

Snap the thumb to discrete increments.

tsx
<Slider defaultValue={50} step={10} label="Opacity" showValue formatValue={(v) => `${v}%`} />

Range

Pass an array to defaultValue and render two SliderThumbs. Use the sub-components for full control.

tsx
import {
  SliderRoot,
  SliderControl,
  SliderTrack,
  SliderIndicator,
  SliderThumb,
  SliderLabel,
  SliderValue,
} from "@rogo-technologies/ui/slider";

<SliderRoot defaultValue={[25, 75]}>
  <div className="flex items-end justify-between">
    <SliderLabel size="md">Price range</SliderLabel>
    <SliderValue size="md">{(_formatted, values) => `$${values[0]} – $${values[1]}`}</SliderValue>
  </div>
  <SliderControl>
    <SliderTrack size="md">
      <SliderIndicator size="md" />
      <SliderThumb size="md" index={0} aria-label="Minimum price" />
      <SliderThumb size="md" index={1} aria-label="Maximum price" />
    </SliderTrack>
  </SliderControl>
</SliderRoot>;

Custom composition

Sub-components accept their own className so you can override track color, indicator style, or thumb appearance.

tsx
<SliderRoot defaultValue={60} min={0} max={100}>
  <div className="flex items-end justify-between">
    <SliderLabel size="md">Custom composition</SliderLabel>
    <SliderValue size="md">{(_formatted, values) => `${values[0]}%`}</SliderValue>
  </div>
  <SliderControl>
    <SliderTrack size="lg" className="bg-quaternary">
      <SliderIndicator size="lg" className="bg-brand-inverted" />
      <SliderThumb size="lg" />
    </SliderTrack>
  </SliderControl>
</SliderRoot>

Controlled

tsx
const [value, setValue] = useState(50);

<Slider value={value} onValueChange={(v) => setValue(v)} label="Volume" showValue />;

API

Slider (composed)

PropTypeDefaultDescription
valuenumber | number[]-Controlled value.
defaultValuenumber | number[]-Uncontrolled initial value.
onValueChange(value: number | number[]) => void-Called during value changes.
onValueCommitted(value: number | number[]) => void-Called on pointer up.
minnumber0Minimum allowed value.
maxnumber100Maximum allowed value.
stepnumber1Step increment.
disabledbooleanfalseDisables the slider.
orientation"horizontal" | "vertical""horizontal"Layout direction.
size"sm" | "md" | "lg""md"Size of the slider.
labelstring-Label text displayed above the track.
showValuebooleanfalseWhether to show the value readout.
formatValue(value: number) => string-Custom value formatter.
classNamestring-Additional CSS classes for the root.
trackClassNamestring-Additional CSS classes for the track.
indicatorClassNamestring-Additional CSS classes for the indicator.
thumbClassNamestring-Additional CSS classes for the thumb.

Sub-components

ComponentDescription
SliderRootRoot container. Accepts all Slider.Root props + size.
SliderControlDraggable interaction area.
SliderTrackThe visible track. Accepts size.
SliderIndicatorThe filled range portion. Accepts size.
SliderThumbThe draggable handle. Accepts size and index (for range).
SliderValueDisplays the current value. Accepts size and children render function.
SliderLabelLabel element. Accepts size.

Guidelines

Do

  • Provide a label or aria-label for accessibility
  • Use showValue when the exact number matters to the user
  • Use formatValue to add units (%, px, °F, etc.)
  • Use step for values that should snap to discrete increments
  • Use range sliders for min/max filters (e.g., price range)

Don't

  • Don't use a slider when only a few discrete values exist. Use radio buttons or a select instead
  • Don't hide the value when precision matters. Show it with showValue
  • Don't use a slider for text input or non-numeric values
  • Don't set min and max too close together, since the control becomes imprecise
PreviousSkeleton
NextSwitch
Made in NYC© 2026 Rogo Technologies Inc.

Design at Rogo

We’re redesigning an entire industry. Come design it with us.

See open roles

Design at Rogo

  • How we workThe mission of design at Rogo, and the open roles
  • About RogoThe company and the product