InputGroup

<InputGroup>TailwindCSS Modules

A container component that joins leading and trailing addons (dropdowns, buttons, prefixes) to an Input field, sharing a single cohesive border and focus ring.

InstallationColoxo CLI
npx coloxo add input-group --style coloxo-css
ES Module ImportPlayground / npm package
import { InputGroup, InputPrefix } from '@coloxo/ui';

Design Tokens:

--cx-bg-secondary: #F8FAFC--cx-border-primary: #E2E8F0--cx-focus-ring: #2348FF--cx-radius-md: 8px

1. Variant Matrix

InputGroups allow you to seamlessly attach prefixes, suffixes, and interactive addons.

Leading AddonTrailing AddonBoth 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"
Height: 36px
US

Dense forms, inline filters

size="md"DEFAULT
Height: 40px
US

Standard forms, settings

size="lg"
Height: 44px
US

Hero search, auth screens

3. Interactive Props Configurator

Leading Addon (US)

Trailing Addon (USD)

Invalid / Error State

Disabled Input

Visual Render Canvas
US

This is a hint text to help user.

tsx
<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.

Copy
US

This is a hint text to help user.

5. Enterprise layout compositions

InputGroups are widely used in financial forms, URL configurations, and international inputs.

https://
USD

Accessibility

Nested Input Scaling

The inner `<Input />` component intercepts props like `size` and edge flattening from the `InputGroup` parent.

Focus Rings

The group manages a single pseudo-focus ring so the entire complex surface appears selected when the embedded input receives focus.

Props

NameTypeDefaultDescription
labelReactNode—Form field label text.
hintReactNode—Helper text displayed below the group.
errorReactNode—Validation message; renders field in invalid state.
size"sm" | "md" | "lg"mdApplied to the child Input component.
leadingAddonReactNode—Joined leading control (e.g. dropdown, icon block).
trailingAddonReactNode—Joined trailing control (e.g. button, text block).
leadingTextstring—Inline prefix text passed through to the Input.