Ink
Density
Selects one value from a range. 2px track, 14px thumb, 24px hit area.
Density
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { Slider } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/slider.
npx @noorddev/vlak-cli add slider
The StyleX leaf lands in components/vlak/, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/slider.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { useState } from "react";
import { Slider } from "@noorddev/vlak-react";
const [volume, setVolume] = useState(62);
<Slider value={volume} onValueChange={setVolume} min={0} max={100} step={1} aria-label="Volume" />A native range input drives the ink track.
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | ||
defaultValue | number | 50 | |
min | number | 0 | |
max | number | 100 | |
step | number | 1 | |
onValueChange | (value: number) => void |
Also accepts Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange">.
| Keys | Does |
|---|---|
| Tab | Moves focus to the slider |
| Arrow right, Arrow up | Increases by step |
| Arrow left, Arrow down | Decreases by step |
| Home, End | Jumps to min or max |
<div class="rs-slider"><span class="rs-slider-fill" style="width:62%"></span><span class="rs-slider-thumb" style="left:62%"></span></div>