InputGroup
<InputGroup>TailwindCSS ModulesA container component that joins leading and trailing addons (dropdowns, buttons, prefixes) to an Input field, sharing a single cohesive border and focus ring.
npx coloxo add input-group --style coloxo-cssimport { InputGroup, InputPrefix } from '@coloxo/ui';Design Tokens:
1. Variant Matrix
InputGroups allow you to seamlessly attach prefixes, suffixes, and interactive addons.
| Leading Addon | Trailing Addon | Both Addons | |
|---|---|---|---|
| States | US | USD | EUR USD |
| Copy Buttons | Copy | Addons can be interactive elements like buttons, dropdown selects, or static text. | |
2. Control heights (Sizes)
The size prop applied to the InputGroup automatically scales the embedded Input and addons.
Sizes Specification Grid
size="sm"Dense forms, inline filters
size="md"DEFAULTStandard forms, settings
size="lg"Hero search, auth screens
3. Interactive Props Configurator
Leading Addon (US)
Trailing Addon (USD)
Invalid / Error State
Disabled Input
This is a hint text to help user.
<InputGroup label="Phone number" leadingAddon={<InputPrefix position="leading">US</InputPrefix>} hint="This is a hint text to help user."> <Input type="tel" placeholder="+1 (555) 000-0000" /></InputGroup>4. Dark theme
InputGroup backgrounds and addon borders invert colors correctly in dark mode.
This is a hint text to help user.
5. Enterprise layout compositions
InputGroups are widely used in financial forms, URL configurations, and international inputs.
Accessibility
The inner `<Input />` component intercepts props like `size` and edge flattening from the `InputGroup` parent.
The group manages a single pseudo-focus ring so the entire complex surface appears selected when the embedded input receives focus.
Props
| Name | Type | Default | Description |
|---|---|---|---|
| label | ReactNode | — | Form field label text. |
| hint | ReactNode | — | Helper text displayed below the group. |
| error | ReactNode | — | Validation message; renders field in invalid state. |
| size | "sm" | "md" | "lg" | md | Applied to the child Input component. |
| leadingAddon | ReactNode | — | Joined leading control (e.g. dropdown, icon block). |
| trailingAddon | ReactNode | — | Joined trailing control (e.g. button, text block). |
| leadingText | string | — | Inline prefix text passed through to the Input. |