Code

<!-- pearl-check.free.js: download it from the Install section below and host it with your site -->
<script src="/pearl-check.free.js" defer></script>

<pearl-check
  label="Remember me"
  checked
  size="36"
  theme="light"
></pearl-check>

<script>
  document.querySelector('pearl-check').addEventListener('change', (e) => {
    console.log(e.detail.checked);
  });
</script>

In context

A group with a mixed parent
Round to-dos, 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-check.json
2. Load it and use the element
HTML
<!-- pearl-check.free.js: download it from the Install section below and host it with your site -->
<script src="/pearl-check.free.js" defer></script>

<pearl-check
  label="Remember me"
  checked
  size="24"
  theme="light"
></pearl-check>

<script>
  document.querySelector('pearl-check').addEventListener('change', (e) => {
    console.log(e.detail.checked);
  });
</script>
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-check.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'pearl-check': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      checked?: boolean | '';
      indeterminate?: boolean | '';
      label?: string;
      shape?: 'square' | 'round';
      size?: number | string;
      theme?: 'light' | 'dark';
      name?: string;
      value?: string;
      disabled?: boolean | '';
      sound?: boolean | '';
    };
  }
}

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 and the full 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
checked booleanoffOn or off. Fires change with detail.checked when the user toggles it.
indeterminate booleanoffShows a dash: some of the items it stands for are selected. Cleared when the user clicks.
label string—Text next to the box; clicking it toggles too. Without a label, set aria-label.
shape 'square' | 'round''square'Round reads as a to-do or a choice.
size number (px)24Box size; the label text scales with it.
theme 'light' | 'dark''light'White porcelain or a dark well.
name / value string—Form field name and value: submitted with the surrounding form when checked.
disabled booleanoffDims it and ignores input.
sound booleanoffA porcelain tap, a little higher when it turns on (plus a tap of vibration on phones). Also on for everything inside an element with data-ui-sound="on".
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'Glow and check colours, or a custom tint. Free build ships Aurora only.

There is a real <input type="checkbox"> inside, so Space toggles it, Tab reaches it, forms submit it and screen readers announce it as a checkbox with its label. Everything is CSS — no WebGL, no canvas — so a long list of them costs nothing. Reduced motion keeps the tile and the glow and drops the pop and the drawn stroke.

More components