Browse the docs
Inputs / TextField

TextField

Focus swipes a highlighter across the label and makes the outline boil. Errors switch to tomato ink and say how to fix it.

Server or clientWCAG AASince v0.1

Optional. Anonymous reports are fine.

Add a street, barangay, or landmark so responders can find it.

Looks good.

Change every prop live in the playground.

Props

TextField

PropTypeDefaultWhat it does
label requiredReactNode—The visible label. Required: every field needs a name.
classNamestringnone—
errorReactNodenoneAn error that says how to fix it. Turns the field tomato and sets aria-invalid.
hintReactNodenoneHelp under the field.
successbooleanfalseShows a green tick when the value is good.

Also takes every attribute of <input> (307 more, e.g. onClick, className, aria-*).

TextArea

PropTypeDefaultWhat it does
label requiredReactNode—The visible label. Required: every field needs a name.
classNamestringnone—
errorReactNodenoneAn error that says how to fix it. Turns the field tomato and sets aria-invalid.
hintReactNodenoneHelp under the field.
ruledbooleantrueNotebook lines behind the text.
successbooleanfalseShows a green tick when the value is good.

Also takes every attribute of <textarea> (291 more, e.g. onClick, className, aria-*).

Use it well

DoWrite errors that say how to fix the problem, not just that there is one.
Don'tUse the placeholder as the label. It disappears as soon as someone types.

Accessibility

  • A real <label> for every field; the label prop is required.
  • Hints and errors are linked with aria-describedby; errors set aria-invalid.
  • Errors carry an icon and words, never color alone.
Five stamps!

All aboard.

You took the whole tour. Here's Holo Pip, a foil sticker for riders who finish. It's in your playground tray now, for good.