Input Group
Combines an input with add-ons, buttons and text.
Installation
npx shadcn@latest add @uqudo/input-groupInstalling it also installs Button, Input and Textarea, which it depends on.
Usage
import {
InputGroup,
InputGroupAddon,
InputGroupButton,
InputGroupInput,
InputGroupText,
InputGroupTextarea,
} from "@/components/uqudo/ui/input-group"<InputGroup>
<InputGroupAddon>
<SearchIcon />
</InputGroupAddon>
<InputGroupInput placeholder="Search..." />
</InputGroup>InputGroup draws the border, background and focus ring; InputGroupInput and
InputGroupTextarea are borderless versions of the regular controls that sit
inside it. Clicking an addon focuses the input.
Examples
With button
InputGroupButton is a compact Button tuned to fit
inside an addon.
With textarea
Use align="block-end" (or block-start) to place an addon below or above a
textarea.
0/500
API Reference
InputGroup
Prop
Type
InputGroupAddon
Prop
Type
InputGroupButton
Prop
Type
InputGroupInput
Prop
Type
InputGroupTextarea
Prop
Type
InputGroupText
Prop
Type
Data attributes
| Attribute | Element | Value |
|---|---|---|
data-slot | InputGroup | input-group |
data-slot | InputGroupAddon | input-group-addon |
data-align | InputGroupAddon | The resolved align. |
data-slot | InputGroupInput, InputGroupTextarea | input-group-control |
data-size | InputGroupButton | The resolved size. |