Forms
Input group
A field with parts inside it: an icon, a prefix, a button that shows a password or clears the text.
import { InputGroup, InputGroupAddon, InputGroupInput } from 'omuk-ui/input-group';Forms
A field with parts inside it: an icon, a prefix, a button that shows a password or clears the text.
import { InputGroup, InputGroupAddon, InputGroupInput } from 'omuk-ui/input-group';Change the props on the right. The input group and its code follow.
import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText } from 'omuk-ui/input-group';
import { Label } from 'omuk-ui/label';
<div className="flex flex-col gap-1">
<Label htmlFor="url">Webhook address</Label>
<InputGroup>
<InputGroupAddon>
<InputGroupText>https://</InputGroupText>
</InputGroupAddon>
<InputGroupInput id="url" placeholder="hooks.example.com/deploy" />
</InputGroup>
</div>The group is the field’s box; the input inside it has none. An addon at the start holds the icon. The clear button shows only while there is text. Type a few letters.
InputGroupText is muted text in an addon: a scheme, a domain, a unit. A press on the addon puts the focus in the field.
An icon button in an addon at the end. A press keeps the focus and the caret in the text. aria-pressed tells a screen reader whether the password shows.
With stacked, the group grows in height: for an InputGroupTextarea, or an addon above or below the text.
Each part also takes the props of its element. InputGroupInput and InputGroupTextarea take every prop of an <input> and a <textarea>.