Skip to content
Ballpoint

Slider

A pencilled line with the chosen range inked over it, and a drawn ring to drag.

From shadcn/ui
Built on Base UI Slider

Installation

pnpm dlx shadcn@latest add @ballpoint/slider

Usage

tsx
import { Slider } from "@/components/ui/slider"

<Slider defaultValue={40} aria-label="Roughness" />
<Slider defaultValue={[20, 70]} aria-label="Range" />

Examples

Controlled

Read the value as it moves: a single pen-pressure value and a price range in steps of five.

35%
$20 – $80

Marks

Ticks under the line, labelled where you say, or one for every step.

Vertical

Upright sliders for levels, each named and read out.

Ink70
Paper40
Lamp85

API reference

marks
boolean | { value: number; label?: string }[]

Pencilled ticks under the line (horizontal only): true for one at every step, or a list of values, each with an optional label written beneath.

step
default 1
number

How far a press of an arrow key, or a drag, moves the value.

orientation
default "horizontal"
"horizontal" | "vertical"

Which way the line runs. A vertical slider takes the height of its parent.

seed
string | number

Pins the drawing.

Every other prop goes to Base UI's Slider.

Pen settings

The drawing also takes draw, weight and speed, as props or from the nearest InkProvider. What each one does.