We only use it to sign you in.

Code

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

<pearl-input
  label="Work email"
  type="email"
  name="email"
  hint="We only use it to sign you in."
  clearable
  size="54"
  theme="light"
></pearl-input>

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

In context

Search, with a clear button
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-input.json
2. Load it and use the element
HTML
<!-- pearl-input.free.js: download it from the Install section below and host it with your site -->
<script src="/pearl-input.free.js" defer></script>

<pearl-input
  label="Work email"
  type="email"
  name="email"
  hint="We only use it to sign you in."
  clearable
  size="54"
  theme="light"
></pearl-input>

<script>
  document.querySelector('pearl-input').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-input.d.ts
declare namespace JSX {
  interface IntrinsicElements {
    'pearl-input': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> & {
      value?: string;
      label?: string;
      placeholder?: string;
      type?: 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'number';
      hint?: string;
      status?: 'idle' | 'error' | 'success';
      clearable?: boolean | '';
      width?: number | string;
      size?: number | string;
      theme?: 'light' | 'dark';
      name?: string;
      autocomplete?: string;
      maxlength?: number | string;
      required?: boolean | '';
      readonly?: boolean | '';
      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
value string''The text. Fires change with detail.value on every keystroke, and submit on Enter.
label string—Lies in the field and lifts to the top edge on focus or once there is text. Without a label, set aria-label.
placeholder string—Example text; with a label it appears only while the field is focused.
type 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'number''text'Password adds a show / hide eye.
hint string—A line under the field: help text, or the error message when status is error.
status 'idle' | 'error' | 'success''idle'Error turns the light coral and shakes once; success turns it green and draws a check.
clearable booleanoffA pearl × that empties the field.
width number (px) | CSS width300Field width; "100%" fills the parent.
size number (px)54Field height; the text scales with it.
theme 'light' | 'dark''light'White porcelain or a dark well.
name / autocomplete / maxlength / required / readonly as on <input>—Passed to the real input inside, so forms, validation and autofill work.
disabled booleanoffDims it and ignores input.
sound booleanoffA soft tick per character and a porcelain tap on the buttons. Also on for everything inside an element with data-ui-sound="on".
tint Pro'aurora' | 'sunset' | 'mint' | 'mono' | object'aurora'Colours of the focus light, or a custom tint. Free build ships Aurora only.

There is a real <input> inside, so the browser's autofill, password managers, form submission and validation all work, and screen readers read the label, the hint and the invalid state. Everything is CSS — no WebGL, no canvas — so a long form costs nothing. It matches Pearl Select, Pearl Check and Pearl Code in height and material, so they line up in one form. Reduced motion keeps the light and drops the flow, the shake and the label slide.

More components