Default

<TextInput label="Your name" placeholder="Enter your name" />

With description and error

We'll never share your email.

Username is already taken.

<TextInput
  label="Email"
  description="We'll never share your email."
  placeholder="your@email.com"
  type="email"
/>
<TextInput
  label="Username"
  withAsterisk
  error="Username is already taken."
/>

Input types

<TextInput label="Email" type="email" placeholder="email@example.com" />
<TextInput label="Password" type="password" />
<TextInput label="Number" type="number" />

Sizes

<TextInput size="xs" label="xs" />
<TextInput size="sm" label="sm" />
<TextInput size="md" label="md" />
<TextInput size="lg" label="lg" />
<TextInput size="xl" label="xl" />

Disabled

<TextInput label="Disabled" disabled value="Cannot be changed" />

Props

PropTypeDefaultDescription
idstringAssociates label with input via HTML for/id
labelReactNodeLabel rendered above the input
descriptionReactNodeHelper text below the label
errorReactNode|booleanError message; pass true for styles only
requiredbooleanMarks as required and adds asterisk
withAsteriskbooleanAdds asterisk without native required attribute
disabledbooleanDisables the input
size'xs'|'sm'|'md'|'lg'|'xl'Font size and height via design tokens
radius'xs'|'sm'|'md'|'lg'|'xl'|stringBorder-radius of the input
typestring'text'HTML input type attribute
placeholderstringPlaceholder text
valuestringPre-fills the input (uncontrolled SSR)
namestringForm field name
classstringAdditional CSS class names
styleobjectInline styles