Input Group

Add addons, buttons, and helper content to inputs.

Installation

npx shadcn add https://hq-ui.vercel.app/r/nova/input-group

Align

Use the align prop on InputGroupAddon to position the addon relative to the input.

inline-start

Use align="inline-start" to position the addon at the start of the input. This is the default.

input-group-inline-start
Icon positioned at the start.

inline-end

Use align="inline-end" to position the addon at the end of the input.

input-group-inline-end
Icon positioned at the end.

block-start

Use align="block-start" to position the addon above the input.

input-group-block-start
Full Name
Header positioned above the input.
script.js
Header positioned above the textarea.

block-end

Use align="block-end" to position the addon below the input.

input-group-block-end
USD
Footer positioned below the input.
0/280
Footer positioned below the textarea.

Examples

Icon

input-group-icon

Text

input-group-text
$
USD
https://
.com
@company.com
120 characters left

Button

input-group-button
https://

Kbd

input-group-kbd
⌘K
input-group-dropdown

Spinner

input-group-spinner
Saving...
Please wait...

Textarea

input-group-textarea
Line 1, Column 1
script.js

API Reference

InputGroup

The main component that wraps inputs and addons.

PropTypeDefault
classNamestring
<InputGroup>
  <InputGroupInput />
  <InputGroupAddon />
</InputGroup>

InputGroupAddon

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

PropTypeDefault
align"inline-start" | "inline-end" | "block-start" | "block-end""inline-start"
classNamestring
<InputGroupAddon align="inline-end">
  <SearchIcon />
</InputGroupAddon>

For <InputGroupInput />, use the inline-start or inline-end alignment. For <InputGroupTextarea />, use the block-start or block-end alignment.

The InputGroupAddon component can have multiple InputGroupButton components and icons.

<InputGroupAddon>
  <InputGroupButton>Button</InputGroupButton>
  <InputGroupButton>Button</InputGroupButton>
</InputGroupAddon>

InputGroupButton

Displays buttons within input groups.

PropTypeDefault
size"xs" | "icon-xs" | "sm" | "icon-sm""xs"
variant"default" | "destructive" | "outline" | "secondary" | "ghost" | "link""ghost"
classNamestring
<InputGroupButton>Button</InputGroupButton>
<InputGroupButton size="icon-xs" aria-label="Copy">
  <CopyIcon />
</InputGroupButton>

InputGroupInput

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>
  <InputGroupInput placeholder="Enter text..." />
  <InputGroupAddon>
    <SearchIcon />
  </InputGroupAddon>
</InputGroup>

InputGroupTextarea

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.

<InputGroup>
  <InputGroupTextarea placeholder="Enter message..." />
  <InputGroupAddon align="block-end">
    <InputGroupButton>Send</InputGroupButton>
  </InputGroupAddon>
</InputGroup>