Starter
Team
Business
Enterprise

Code

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

<pearl-select label="Plan" value="Team" name="plan" size="54" theme="light">
  <option>Starter</option>
  <option>Team</option>
  <option>Business</option>
  <option disabled>Enterprise</option>
</pearl-select>

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

In context

Portugal
Spain
France
Germany
Italy
Netherlands
Sweden
Poland
Ukraine
United Kingdom
In a form, next to Pearl Input
Newest first
Oldest first
Most popular
Mint, no label 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-select.json
2. Load it and use the element
HTML
<!-- pearl-select.free.js: download it from the Install section below and host it with your site -->
<script src="/pearl-select.free.js" defer></script>

<pearl-select label="Plan" value="Team" name="plan" size="54" theme="light">
  <option>Starter</option>
  <option>Team</option>
  <option>Business</option>
  <option disabled>Enterprise</option>
</pearl-select>

<script>
  document.querySelector('pearl-select').addEventListener('change', (e) => {
    console.log(e.detail.value);
  });
</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-select.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'pearl-select': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      value?: string;
      label?: string;
      placeholder?: string;
      width?: number | string;
      size?: number | string;
      theme?: 'light' | 'dark';
      name?: 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
<option> children—The choices, written like a native select: text is the label, value="…" the value, disabled greys one out. From script: el.options = [{ value, label }].
value string''The chosen value. Fires change with detail.value when the user picks another.
label string—Lies in the field and lifts above the value once something is chosen. Without a label, set aria-label.
placeholder string'Select…'Shown while nothing is chosen, when there is no label.
width number (px) | CSS width300Field width; the list matches it.
size number (px)54Field height; the text and the rows scale with it.
theme 'light' | 'dark''light'White porcelain or a dark well.
name string—Form field name: a hidden input carries the value into the surrounding form.
disabled booleanoffDims it and ignores input.
sound booleanoffA porcelain tap on open and on choice. Also on for everything inside an element with data-ui-sound="on".
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'Colours of the light and the check, or a custom tint. Free build ships Aurora only.

It is a button with a listbox: Enter, Space or the arrows open it, the arrows and Home / End move, typing a letter jumps to the option that starts with it, Enter chooses and Escape closes. The list drops upward when there is no room below. It is positioned inside the component, so a parent with overflow: hidden will clip it — give that parent room or let it overflow. Same height and material as Pearl Input, so they line up in one form. All CSS, no WebGL.

More components