Forms
Input
A text field, 32 tall, with one edge, one focus ring and a red edge when it is invalid.
Forms
A text field, 32 tall, with one edge, one focus ring and a red edge when it is invalid.
Change the props on the right. The input and its code follow.
import { Input } from 'omuk-ui/input';
import { Label } from 'omuk-ui/label';
<div className="flex flex-col gap-1">
<Label htmlFor="name">Project name</Label>
<Input id="name" placeholder="Billing service" />
</div>A Label above, linked with htmlFor. The field is 32 tall: the same as a default button, so they line up in a row.
Set aria-invalid, not a class: the edge turns red, and a screen reader says the field is invalid. Link the message with aria-describedby.
Enter an email address with a domain, like ada@example.com.
Disabled is a state, not a fade: the hover fill, a thin edge and muted text.
Input takes every prop of an <input>, and adds none. Its look comes from the field recipe that every field shares.