Input Group
A composable component for combining inputs with icons, buttons, and text addons. Supports prefix and suffix addons for inputs, and block addons for textareas.
Usage
import {
InputGroup,
InputGroupAddon,
InputGroupButton,
InputGroupInput,
InputGroupText,
InputGroupTextarea,
} from "@/components/ui/input-group"Examples
Icon prefix
<InputGroup>
<InputGroupAddon align="inline-start">
<SearchIcon />
</InputGroupAddon>
<InputGroupInput placeholder="Search..." />
</InputGroup>Icon suffix
<InputGroup>
<InputGroupInput placeholder="Enter email..." />
<InputGroupAddon align="inline-end">
<AtSignIcon />
</InputGroupAddon>
</InputGroup>Button suffix
<InputGroup>
<InputGroupInput placeholder="Enter email..." />
<InputGroupAddon align="inline-end">
<InputGroupButton><EyeIcon /></InputGroupButton>
</InputGroupAddon>
</InputGroup>Textarea with send button
<InputGroup>
<InputGroupTextarea placeholder="Write a message..." rows={3} />
<InputGroupAddon align="block-end">
<InputGroupButton><SendIcon /></InputGroupButton>
</InputGroupAddon>
</InputGroup>Last updated on