64%

Code

<script src="/pearl-dial.free.js" defer></script>

<pearl-dial
  value="64"
  unit="%"
  size="170"
  theme="light"
  label="Volume"
></pearl-dial>

In context

21.5°
Living room
Thermostat
38
72
Mixer, Mint and Sunset Pro

Install · Free Web Component

One file, no dependencies. Aurora preset, every other option included. Host it yourself so your visitors never load anything from our servers.

1. Install with one command — or download the file
shadcn CLI · React
npx shadcn@latest add https://www.ui-design.co/r/pearl-dial.json
2. Load it and use the element
HTML
<script src="/pearl-dial.free.js" defer></script>

<pearl-dial
  value="64"
  unit="%"
  size="132"
  theme="light"
  label="Volume"
></pearl-dial>
3. React + TypeScript (optional)

The shadcn command adds a typed React wrapper for you. Using the file directly? Custom elements work in React as-is; for type checking add:

TypeScript
// pearl-dial.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'pearl-dial': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      value?: number | string;
      min?: number | string;
      max?: number | string;
      step?: number | string;
      unit?: string;
      size?: number | string;
      theme?: 'light' | 'dark';
      label?: string;
    };
  }
}

Pro · React + TypeScript Pro

One payment of $4.99, yours forever. Use it in unlimited personal and commercial projects; no resale.

  • React component (controlled or uncontrolled, custom face) with TypeScript types, the shared WebGL core and the GLSL source
  • Sunset, Mint and Mono tints, plus custom tints from Brand Fit
  • The vanilla Web Component with every tint, a demo page, README and license

Attributes & props

NameTypeDefaultDescription
sound booleanoffPlays a short synthesised a tick per step (and a tap of vibration on phones) when used. Also on for everything inside an element with data-ui-sound="on".
value number0Current value. Fires change as it turns.
min / max number0 / 100The range; a full turn covers it.
step number1Snap increment, also used by the arrow keys.
unit string—Small text after the number, such as % or °.
size number (px)132Diameter; the number scales with it.
theme 'light' | 'dark''light'White porcelain or a dark body.
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'Halo colours, or a custom tint. Free build ships Aurora only.

A real slider for assistive tech: arrow keys step, Page Up and Page Down jump a tenth of the range, Home and End go to the ends. The dial stops at 12 o'clock on both sides instead of wrapping. The body and the dot are CSS, so without WebGL only the halo is missing. All library components on a page share one WebGL context.

More components