1. Docs
  2. Components
  3. 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.

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.

PropTypeDefault
classNamestring

InputGroup.Addon

Displays icons, text, buttons, or other content alongside inputs.

PropTypeDefault
align"inline-start" | "inline-end" | "block-start" | "block-end""inline-start"
classNamestring

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.

PropTypeDefault
size"xs" | "icon-xs" | "sm" | "icon-sm""xs"
variant"default" | "destructive" | "outline" | "secondary" | "ghost" | "link""ghost"
classNamestring

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.

PropTypeDefault
classNamestring

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.

PropTypeDefault
classNamestring

All other props are passed through to the underlying Textarea component.