Garage

Input takes a single line of text.

Try a client, a year or a tool.

variant

outline | soft | ghost | underline

size

micro | tiny | small | medium | large

color

accent | blue | red | amber | black

shape

sharp | square | round

loading

boolean

disabled

boolean

showLabel

boolean

icon

ReactNode

prefix

string

suffix

string

clearable

boolean

helpText

string

error

string

<Input
  label="Search projects"
  showLabel
  icon={<Search />}
  clearable
  helpText="Try a client, a year or a tool."
/>

Anatomy

Every part an input can carry, all switched on at once. Real fields only use a few. You'd never put a currency symbol and an email domain in the same one.

Help text

PartPropNotes
LabellabelAlways set. Hidden from sight unless showLabel is on, but still read out.
IconiconA leading glyph, like the search glass.
PrefixprefixFixed text before the value, like a currency symbol.
ValuevalueWhat the person types.
ClearclearableAppears once there's a value. It's a real button, so it can be tabbed to.
SuffixsuffixFixed text after the value, like an email domain.
Help texthelpTextLinked with aria-describedby, so it's read after the label.
ErrorerrorTakes the help text's place, turns the border red and sets aria-invalid.