Skip to content

    Browse components

    Ruler Input

    Design-tool number field: drag sideways to scrub the value over a sliding tick ruler, Shift for coarse, Alt for fine, and it stretches like rubber at the limits. Click to type, arrows to step.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/ruler-input

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/ruler-input.json

    Usage

    import { RulerInput } from "@/components/ui/ruler-input";
    
    <RulerInput label="Radius" unit="px" min={0} max={72} value={radius} onChange={setRadius} />

    Props

    PropTypeDefaultDescription
    labelstring"Opacity"Field label.
    unitstring"%"Suffix after the number.
    minnumber0Minimum value.
    maxnumber100Maximum value.
    stepnumber1Step per notch. Alt scrubs at a tenth of it.
    pixelsPerStepnumber4Pointer px per step while scrubbing.
    valueReactNode—Controlled value, pair with onChange.
    defaultValueReactNode—Initial value when uncontrolled (64).
    onChangeReactNode—(value: number) => void.
    classNamestring—Extra classes for the root element.