Input

Molecule

Text input field with label, hint, error, prefix icon, password toggle, and 3 size variants.

Props EditorInteractive
<Input id="field" label="Email" type="email" placeholder="you@example.com" />

Default

Preview

We'll never share your email.

Code
<Input id="email" label="Email" type="email" placeholder="you@example.com" hint="We'll never share your email." />

Error

Preview
Code
<Input id="email" label="Email" type="email" error="A valid email address is required." required />

Disabled

Preview
Code
<Input id="email" label="Email" type="email" placeholder="you@example.com" disabled />

Prefix / suffix icon

Preview
🔍
$
Code
<Input id="search" label="Search" prefixIcon={<SearchIcon />} placeholder="Search…" />
<Input id="amount" label="Amount" suffixIcon={<span>$</span>} type="number" />

Clearable

Preview
Code
function Demo() {
  const [v, setV] = useState('');
  return <Input id="clr" label="Label" value={v} onChange={(e) => setV(e.target.value)}
    clearable onClear={() => setV('')} />;
}

Success state

Preview

Username is available!

Code
<Input id="username" label="Username" value="johndoe" success="Username is available!" />

Read only

Preview
Code
<Input id="api-key" label="API Key" value="sk-abc123xyz" readOnly />

Character counter

Preview

0/50

Code
<Input id="bio" label="Bio" value={v} onChange={(e) => setV(e.target.value)} maxLength={50} showCount />

Password with eye toggle

Preview

Min. 8 characters

Code
<Input id="password" label="Password" type="password" value={v} onChange={setV} />

Number stepper

Preview
Code
<Input id="qty" label="Quantity" type="number" value={v} onChange={setV} min={0} max={99} />

Prefix / suffix text

Preview
https://
@
USD
Code
<Input id="website" label="Website"
  prefixIcon={<span className="text-text-secondary text-xs font-mono">https://</span>}
  placeholder="yoursite.com" />

<Input id="handle" label="Twitter handle"
  prefixIcon={<span className="text-text-secondary">@</span>}
  placeholder="username" />

<Input id="price" label="Price"
  suffixIcon={<span className="text-text-secondary">USD</span>}
  type="number" />

Loading state

Preview
Loading…

Checking availability…

Code
<Input id="username" label="Username" value={v} onChange={setV}
  suffixIcon={<Spinner size="xs" />}
  hint="Checking availability…" />
Sourcemodules/ui/Input.tsx