https://
<InputGroup className="max-w-xs">
<InputGroupAddon>https://</InputGroupAddon>
<Input placeholder="example.com" />
</InputGroup>Installation
npm
pnpm
yarn
bun
npx shadcn@latest add @dotui/inputUsage
import { Input, InputGroup, InputGroupAddon } from '@/components/ui/input'<InputGroup>
<InputGroupAddon>https://</InputGroupAddon>
<Input placeholder="example.com" />
</InputGroup>Anatomy
An InputGroup wraps an Input or TextArea together with one or more InputGroupAddon parts. Order the children to place an addon before or after the control.
import {
Input,
InputGroup,
InputGroupAddon,
TextArea,
} from '@/components/ui/input'
;<InputGroup>
<InputGroupAddon />
<Input />
<InputGroupAddon />
</InputGroup>InputGroup— the wrapper; clicking anywhere inside focuses the control.InputGroupAddon— a slot for buttons, icons, labels, orKbdalongside the control.Input/TextArea— the wrapped control.
Sizes
Set size on the InputGroup to scale the group and its control. Available sizes are sm, md (default), and lg.
<InputGroup size="sm">…</InputGroup>
<InputGroup size="md">…</InputGroup>
<InputGroup size="lg">…</InputGroup>Examples
With Prefix
https://
Vertical Comment Form
Form in Card
Card with Input Group
This is a card with an input group.
https://
0/500 characters
Interactive Addons
This is a description of the input group.
This is a description of the input group.
https://
API Reference
An input group combines an input with addons like buttons, icons, or labels.
| Prop | Type | Default | |
|---|---|---|---|
"lg" | "md" | "sm" | "md" | ||
ReactNode | function | — | ||
boolean | — | ||
boolean | — | ||
An addon rendered inside an `InputGroup` alongside the input.
Supports all div attributes.
| Prop | Type | Default | |
|---|---|---|---|
Last updated on 7/15/2026