Skip to main content

RulerPicker

A swipeable tick scale with a lit value flag, under a heading that carries an inline mode select.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

A swipeable tick scale with a lit value flag, under a heading that carries an inline mode select.

Accessibility​

Fully keyboard operable: Tab to focus, Enter/Space to activate. The visible focus ring uses --focus-ring — never remove it. Provide an accessible label (aria-label) for icon-only controls.

Install and import​

npx shadcn@latest add @prism/ruler-picker
import { RulerPicker } from '@/components/prism/RulerPicker';

In a no-build prototype, read it from the bundle instead: const { RulerPicker } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
labelstring—Quiet prefix in the heading, e.g. "Simulate".
options(RulerOption | string)[]—Inline mode select shown after the label. Omit for a plain ruler.
modestring—
onModeChange(mode: string) => void—
valuenumber—
minnumber—
maxnumber—
stepnumber—Smallest increment; the value always snaps to it.
majorEverynumber—Labelled major tick every N steps.
pxPerStepnumber—Pixels per step — the scale's "gearing". Larger = finer control.
formatValue(v: number) => React.ReactNode—
formatTick(v: number) => React.ReactNode—
onChange(value: number) => void—
captionstring—Accessible name for the scale.