Slider
A rolling pill-track tier slider and an elastic liquid range slider with over-drag and velocity tilt.
Customize
Installation
Add the rolling pill-track slider or the elastic liquid slider with the registry command:
npx shadcn@latest add @kinetic/tier-slider
npx shadcn@latest add @kinetic/sliderRolling tier rating
Use RollingTierRating for a five-tier experience rating slider with a rolling label, rolling caption, and numeric counter (01 through 05).
import { RollingTierRating } from "@/components/kinetic/ui/tier-slider";
export function ExperienceRating() {
return <RollingTierRating defaultValue={3} aria-label="Experience rating" />;
}Tier slider items
Use TierSlider with items to build a discrete stepped selector for plans, storage tiers, or quality presets. Enable showHeader and showLabels to display the rolling label and clickable step buttons.
"use client";
import { useState } from "react";
import { TierSlider, type TierSliderItem } from "@/components/kinetic/ui/tier-slider";
const STORAGE_TIERS: readonly TierSliderItem[] = [
{ label: "5 GB", caption: "Personal" },
{ label: "50 GB", caption: "Starter" },
{ label: "200 GB", caption: "Pro" },
{ label: "1 TB", caption: "Studio" },
];
export function StorageTierPicker() {
const [tier, setTier] = useState(2);
return (
<TierSlider
aria-label="Storage plan"
items={STORAGE_TIERS}
value={tier}
onValueChange={setTier}
showHeader
showLabels
/>
);
}Continuous pill mode
Omit items on TierSlider for a continuous numeric pill slider with 1:1 pointer drag, internal ticks that fade around the active dot, and min, max, step, tickCount, and formatValue.
import { TierSlider } from "@/components/kinetic/ui/tier-slider";
export function ExportQualitySlider() {
return (
<TierSlider
defaultValue={64}
min={0}
max={100}
step={1}
tickCount={7}
formatValue={(value) => `${value}%`}
aria-label="Export quality"
/>
);
}Elastic liquid usage
Import Slider from @/components/kinetic/ui/slider when you want single-value or multi-thumb range selection with a liquid track:
import { Slider } from "@/components/kinetic/ui/slider";
export function Volume() {
return <Slider defaultValue={[50]} aria-label="Volume" />;
}Range and step
Set min, max, and step on Slider. Values are arrays with one entry per thumb: pass two or more entries for a range slider, and thumbs cannot cross each other.
<Slider min={0} max={10} step={1} defaultValue={[5]} />Controlled state
Pass value with onValueChange. Use onValueCommit on Slider to react when a drag ends or a key press changes the value. Pass name to submit values with a form.
const [value, setValue] = useState([40]);
<Slider value={value} onValueChange={setValue} aria-label="Volume" />Value pill
On Slider, the value pill appears while a thumb is dragged or focused. Disable it with showTooltip={false} or format it with formatValue.
<Slider defaultValue={[60]} formatValue={(v) => `${v}%`} />
<Slider defaultValue={[60]} showTooltip={false} />Elastic feel
Tune Slider physics with rubberBand (over-drag distance in pixels, capped at 32), liquidBulge (track bulge in pixels, capped at 14), and velocityTilt (pill tilt in degrees, capped at 30). Both TierSlider and Slider accept size as sm, md, or lg.
<Slider defaultValue={[30]} rubberBand={20} liquidBulge={10} velocityTilt={8} size="lg" />Motion preferences
Spring transitions, elastic over-drag, liquid bulge, and tilt settle immediately when reduced motion is enabled, either in the browser or in the Kinetic setting. Time-based effects use the current tempo and the speed prop.
API Reference
TierSlider
Zero-dependency pill-track slider supporting discrete tier items with rolling vertical header and continuous numeric mode with 1:1 drag and auto-hiding ticks.
| Prop | Type | Default | Description |
|---|---|---|---|
items | readonly TierSliderItem[] | - | Optional tier items ({ label, shortLabel?, caption?, value? }). Providing 2+ items enables discrete mode; omitting switches to continuous numeric mode. |
value / defaultValue / onValueChange | number / number / (value: number) => void | 0 (discrete) / min (continuous) | Controlled or initial tier index (discrete) or numeric value (continuous) and change callback. |
min / max / step | number | 0 / 100 / 1 | Lower bound, upper bound, and step increment used in continuous numeric mode. |
size / accent | "sm" | "md" | "lg" / string | "lg" / undefined | Scales track height (32, 48, 64 px), dot size, and typography; accent overrides the active dot color when provided. |
showHeader / showNumber / showLabels | boolean | false / true / true | Shows the rolling label/caption header, displays the zero-padded step counter (01, 02, ... or item.value), and renders clickable step label buttons below the track. |
tickCount / formatValue | number / (value: number) => string | 7 | Tick count in continuous mode when step creates more than 10 intervals, and accessible aria-valuetext formatter. |
speed / disabled / name | number / boolean / string | 1 / false | Transition speed multiplier (0.25-4), disabled state, and native range input name. |
RollingTierRating
Preset five-tier experience rating slider built on TierSlider with rolling header, accent dot, and step number counter enabled by default.
| Prop | Type | Default | Description |
|---|---|---|---|
defaultValue / accent | number / string | 3 / "#FF5A1F" | Initial 0-based rating index into the five default tiers and default highlight color for the active dot. |
...props | TierSliderProps | - | Accepts all TierSlider props including custom items, size, showHeader, showNumber, showLabels, speed, and disabled. |
Slider
Zero-dependency tactile range slider with organic liquid track swell, edge rubber-banding, click-to-jump spring, and velocity-tilted tooltip.
| Prop | Type | Default | Description |
|---|---|---|---|
value / defaultValue | readonly number[] | [50] | Controlled or uncontrolled thumb values. Pass 1 value for single slider or 2+ values for a range slider. |
onValueChange / onValueCommit | (value: number[]) => void | - | Live callback fired while dragging or stepping, and commit callback fired on pointer release or keyboard commit. |
min / max / step | number | 0 / 100 / 1 | Lower bound, upper bound, and quantization step. |
size | "sm" | "md" | "lg" | "md" | Scales track thickness, thumb diameter, hit target height, and liquid bulge spread. |
liquidBulge | number | 6 | Maximum liquid swell amplitude (px) around the active thumb while dragging (0 disables). |
rubberBand | number | 14 | Maximum elastic over-drag displacement (px) when pulling past min or max edges (0 disables). |
velocityTilt | number | 14 | Maximum inertia tilt angle (deg) of the floating value pill based on drag velocity. |
showTooltip / formatValue | boolean / (value: number) => string | true | Controls visibility and text formatting of the floating value pill above the active thumb. |
speed / disabled | number / boolean | 1 / false | Spring time scale multiplier (0.25-4) and disabled state. |