Loading preview
Coffee Order Dial
InputsA café dial for choosing a drink, with a cup that shows what goes into it.
A synth-style knob you drag, scroll or use the keyboard to turn, with an LED ring.
npx shadcn@latest add @venusui/volume-knobRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/volume-knob.tsxThe code behind the preview above.
volume-knob-demo.tsx
import { VolumeKnob } from "@/components/ui/volume-knob"
export default function VolumeKnobDemo() {
return (
<div className="flex flex-wrap items-end justify-center gap-10">
<VolumeKnob label="Volume" defaultValue={62} />
<VolumeKnob label="Bass" defaultValue={0} min={-12} max={12} step={1} format={(v) => `${v > 0 ? "+" : ""}${v} dB`} />
</div>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| value, defaultValue | number | 50 | Controlled or initial value. |
| onValueChange | (value: number) => void | — | Called as it turns. |
| min, max, step | number | 0, 100, 1 | Range and step. |
| label | string | "Volume" | Accessible name and caption. |
| format | (value: number) => string | — | Formats the readout and the value read to screen readers, e.g. +3 dB. |
All <div> props except onChange and defaultValue.
DRAG_RANGE (pixels for the full range) in the file.slider with value text; arrow keys step, Page Up/Down jump a tenth, Home and End go to the ends.touch-none; make sure a parent isn't capturing the touch first.Unknown registry "@venusui"npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.No components.json foundnpx shadcn@latest init in your project first.A café dial for choosing a drink, with a cup that shows what goes into it.
A wall plate of rocker switches that light a row of pendant bulbs.
A graphic equalizer panel with faders, LED columns, a response curve and presets.