Input Group

PreviousNext

Wrap inputs with inline prefix/suffix text, icons, and buttons.

Input groups extend a standard input with inline addons — text labels, icons, or action buttons — without breaking focus or error state handling.

Prefix Text

https://

Suffix Text

USD
.com

Prefix and Suffix

$
per month

With Icon

With Button

Use InputGroupButton to embed an action directly inside the input.

Block Addons

Use align="block-start" or align="block-end" to place the addon above or below the input rather than inline.

Website URL
.com

With Textarea

Use InputGroupTextarea in place of InputGroupInput for multi-line input.

Message

Error State

Add aria-invalid="true" to InputGroupInput or InputGroupTextarea to trigger the error border on the group.

@

This username is already taken.

API Reference

InputGroup

Wrapper that manages the group border, focus ring, and error state. Extends div.

PropTypeDefaultDescription
classNamestring-Additional CSS classes

InputGroupAddon

Container for inline or block addons. Click on the addon focuses the child input.

PropTypeDefaultDescription
align"inline-start" | "inline-end" | "block-start" | "block-end""inline-start"Addon placement relative to the input
classNamestring-Additional CSS classes

InputGroupText

Styled span for text and icon content inside an addon.

PropTypeDefaultDescription
classNamestring-Additional CSS classes

InputGroupButton

A button rendered inside an addon. Wraps the shadcn Button with compact sizing variants.

PropTypeDefaultDescription
size"xs" | "sm" | "icon-xs" | "icon-sm""xs"Button size
variantButtonProps["variant"]"ghost"Visual variant
type"button" | "submit" | "reset""button"Button type attribute
classNamestring-Additional CSS classes

InputGroupInput

A borderless input that fills available space within the group.

PropTypeDefaultDescription
aria-invalid"true" | boolean-Marks the group as invalid, triggering the error state
classNamestring-Additional CSS classes

Accepts all standard input HTML attributes.

InputGroupTextarea

A borderless textarea that fills available space within the group.

PropTypeDefaultDescription
aria-invalid"true" | boolean-Marks the group as invalid, triggering the error state
rowsnumber-Number of visible rows
classNamestring-Additional CSS classes

Accepts all standard textarea HTML attributes.