Input Group
Input Group combines an input or textarea with tightly related icons, units, text, shortcuts, or inline actions.
Purpose
Input Group combines an input or textarea with tightly related icons, units, text, keyboard shortcuts, or inline actions.
Affixed inputs
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/input-groupImport
import { InputGroup, InputGroupAddon, InputGroupInput, InputGroupText, InputGroupTextarea } from "@/components/ui/input-group";Need the machine-readable source metadata? View registry JSON.
Usage
Use Input Group for prefixes, suffixes and merged text areas. Do not fake affixes with absolute-positioned local markup.
import { InputGroup, InputGroupAddon, InputGroupInput } from "@/components/ui/input-group";
export function Example() {
return (
<InputGroup>
<InputGroupAddon>https://</InputGroupAddon>
<InputGroupInput aria-label="Domain" placeholder="domain.com" />
</InputGroup>
);
}Examples
Icons, text affixes, action addons, variants, sizes, states and form wiring are compositions of the same primitives.
With icon
Clicking an addon focuses the field; interactive children are excluded.
Text affixes
Currency
With button
Password toggle
Textarea group
Soft variant
Small size
The group adjusts addon padding when the input renders at size sm.
Disabled
A disabled input dims the whole group including addons.
Field with error
Form integration
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
InputGroupAddon alignaccepts"inline-start","inline-end","block-start", or"block-end". Block start places the addon row above the field.- Use
InputGroupTextfor non-interactive prefixes, suffixes, and units. - Kbd may be placed in an addon and receives the native radius and spacing treatment.
- Put real Button controls in an addon for copy, reveal, submit, or composer actions. Textarea groups include native Button layout for action rows.
- Use Input Group only when the addon is tightly coupled to the field value.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Focus and invalid rings wrap the complete group.
- Empty addon space may focus the field; an interactive child keeps its own Button action.
- The group itself does not animate, and invalid or disabled state must not change its dimensions.
Accessibility
- Give every input or textarea a visible FieldLabel,
aria-label, oraria-labelledby. - Every interactive addon Button needs its own accessible name.
- Supporting text, icons, units, and Kbd hints must not become the field's only label.
- Connect invalid state to the field and render a visible FieldError.
Implementation Guidance
- Use
aligninstead of custom addon layout. - Use Input for a plain field without closely related addons.
- Preserve focus routing, group rings, textarea action layout, and child control semantics.