- Docs
- Components
- Input Group
Input Group
Display additional information or actions to an input or textarea.
Installation
Anatomy
Examples
Icon
Text
Display additional text information alongside inputs.
Button
Add buttons to perform actions within the input group.
Tooltip
Add tooltips to provide additional context or help.
Textarea
Input groups also work with textarea components. Use block-start or block-end for alignment.
Spinner
Show loading indicators while processing input.
Label
Add labels within input groups to improve accessibility.
Dropdown
Pair input groups with dropdown menus for complex interactions.
Button Group
Wrap input groups with button groups to create prefixes and suffixes.
API Reference
InputGroup.Root
The main component that wraps inputs and addons.
| Prop | Type | Default |
|---|---|---|
className | string |
InputGroup.Addon
Displays icons, text, buttons, or other content alongside inputs.
For proper focus navigation, the InputGroup.Addon component should be
placed after the input. Set the align prop to position the addon.
| Prop | Type | Default |
|---|---|---|
align | "inline-start" | "inline-end" | "block-start" | "block-end" | "inline-start" |
className | string |
For InputGroup.Input, use the inline-start or inline-end alignment. For InputGroup.Textarea, use the block-start or block-end alignment.
The InputGroup.Addon component can have multiple InputGroup.Button components and icons.
InputGroup.Button
Displays buttons within input groups.
| Prop | Type | Default |
|---|---|---|
size | "xs" | "icon-xs" | "sm" | "icon-sm" | "xs" |
variant | "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "ghost" |
className | string |
InputGroup.Input
Replacement for Input when building input groups. This component has the input group styles pre-applied and uses the unified data-slot="input-group-control" for focus state handling.
| Prop | Type | Default |
|---|---|---|
className | string |
All other props are passed through to the underlying Input component.
InputGroup.Textarea
Replacement for Textarea when building input groups. This component has the textarea group styles pre-applied and uses the unified data-slot="input-group-control" for focus state handling.
| Prop | Type | Default |
|---|---|---|
className | string |
All other props are passed through to the underlying Textarea component.