InputGroup

Prefix/suffix addon wrapper for Input; InputGroupAddon renders inline icons/units inside the field border; ButtonGroup collapses adjacent button borders

Category: inputs · WCAG 2.2-AA · form, input, addon, group, layout

Props

PropTypeDefaultDescription
prefixReactNodeContent rendered before the input (leading adornment).
suffixReactNodeContent rendered after the input (trailing adornment).
childrenReactNodeContent rendered inside the component.

Design tokens

When to use

When not to use

How to build an accessible InputGroup in React →

Examples

With prefix

<InputGroup prefix="https://"><Input placeholder="example.com" /></InputGroup>

With leading icon addon

<InputGroup><InputGroupAddon><svg viewBox="0 0 16 16" width="16" height="16"><circle cx="6" cy="6" r="4" fill="none" stroke="currentColor" strokeWidth="1.5"/><path d="M10 10l3 3" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"/></svg></InputGroupAddon><Input placeholder="Search…" aria-label="Search" /></InputGroup>

With trailing unit addon

<InputGroup><Input placeholder="0.00" aria-label="Weight" /><InputGroupAddon align="inline-end">kg</InputGroupAddon></InputGroup>

ButtonGroup

<ButtonGroup><Button>Left</Button><Button>Right</Button></ButtonGroup>

Related components

← Back to docs