Code

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

<pearl-slider
  value="62"
  width="340"
  size="34"
  theme="light"
  label="Brightness"
></pearl-slider>

In context

Brightness70%
Display settings
Volume45
Balance58
Sound, 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-slider.json
2. Load it and use the element
HTML
<script src="/pearl-slider.free.js" defer></script>

<pearl-slider
  value="62"
  width="280"
  size="30"
  theme="light"
  label="Brightness"
></pearl-slider>
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-slider.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'pearl-slider': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      value?: number | string;
      min?: number | string;
      max?: number | string;
      step?: number | string;
      size?: number | string;
      width?: 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) 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 moves.
min / max number0 / 100The range.
step number1Snap increment, also used by the arrow keys.
width number (px)280Track width. In React you can also set any CSS width through style.
size number (px)30Thumb diameter; the groove scales with it.
theme 'light' | 'dark''light'White porcelain or a dark groove.
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'Fill and halo colours, or a custom tint. Free build ships Aurora only.

Press anywhere on the track and the thumb comes to you. Arrow keys step, Page Up and Page Down jump a tenth of the range, Home and End go to the ends. Reduced motion stops the light from flowing. The groove, fill and thumb are CSS, so without WebGL only the thumb's halo is missing. All library components on a page share one WebGL context.

More components