Knob

PreviousNext

A circular knob control for adjusting values. Built on audio-ui primitives.

A knob component for adjusting values with a circular, rotary control. Perfect for audio parameter controls, filters, and effects.

Knob arc

Installation

pnpm dlx shadcn@latest add @audio/knob

Usage

import { Knob } from "@/components/audio/knob";

Basic Knob

<Knob
  defaultValue={50}
  max={100}
  min={0}
  step={1}
/>

Size Variants

Knob arc
Knob arc
Knob arc
Knob arc

API Reference

Knob

Props

PropTypeDefaultDescription
size"sm" | "default" | "lg" | "xl""default"Size variant.
classNamestring-Additional CSS classes.
valuenumber-Controlled value.
defaultValuenumber-Uncontrolled default value.
minnumber0Minimum value.
maxnumber100Maximum value.
stepnumber1Step increment.
disabledbooleanfalseWhether the knob is disabled.
onValueChange(value: number) => void-Callback when value changes during interaction.
onValueCommit(value: number) => void-Callback when value is committed (on release).

All other props are inherited from the KnobPrimitive.RootProps from audio-ui.

Examples

Filter Control

Knob arc
1000 Hz

Multiple Knobs

Knob arc
Gain
Knob arc
Reverb
Knob arc
Delay

Notes

Important Information:
  • Built on audio-ui: This component is built on top of the audio-ui package primitives, providing a high-quality, accessible knob control.
  • Visual Feedback: The knob displays an arc indicator showing the current value range and a pointer indicating the exact value.
  • Size Variants: Four size variants are available: sm, default, lg, and xl. These affect the overall knob diameter.
  • Interaction: The knob supports mouse drag, touch, and keyboard navigation for adjusting values.

Last updated 12/24/2025