Install
Pull Input Group from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { InputGroup } from "@brika/clay";import { InputGroup } from "@brika/clay/components/input-group";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
import {
InputGroup,
InputGroupAddon,
InputGroupInput,
InputGroupText,
} from '@brika/clay/components/input-group';
/** Currency field with dollar-sign prefix and currency code suffix. */
export default function InputGroupDefaultDemo() {
return (
<div className="w-full max-w-xs">
<InputGroup>
<InputGroupAddon>
<InputGroupText>$</InputGroupText>
</InputGroupAddon>
<InputGroupInput placeholder="0.00" type="number" min={0} step={0.01} />
<InputGroupAddon align="inline-end">
<InputGroupText>USD</InputGroupText>
</InputGroupAddon>
</InputGroup>
</div>
);
}Input Group, every way
Code Editor
Multiline editor with a file-header toolbar and a footer Run action.
Username field with a fixed company domain suffix.
Kbd
Search input with a trailing ⌘K keyboard shortcut hint.
Search
Search field with a leading icon and a trailing clear button.
Textarea
Multiline field with a block-end helper showing remaining characters.
Url
URL field with scheme prefix and TLD suffix.
Accessibility
- Addons are presentational, always pair the group with a
<Label>that describes the full field. - Icon-only addon buttons require an
aria-label. - The visible prefix (e.g. "https://") is part of the label context; announce it via
aria-labelon the input if needed.
Theme tokens
Every CSS variable Input Group reads, with its default and the
dotted path you'd write in a ThemeConfig JSON
to override it. Set any of these in your theme to retune Input Group
without touching component code.
Input Group tokens
9 tokens--input-group-containercolorvar(--input-container)components.inputGroup.containerBackground color of the InputGroup wrapper. Inherits the standalone Input container so themes that retune `--input-container` retune the group automatically.
--input-group-labelcolorvar(--input-label)components.inputGroup.labelDefault foreground color of text rendered inside the InputGroup wrapper. Mirrors `--input-label`.
--input-group-bordercolorvar(--input-border)components.inputGroup.borderResting border color of the InputGroup wrapper. Mirrors `--input-border`.
--input-group-focus-bordercolorvar(--ring)components.inputGroup.focusBorderBorder color drawn on the wrapper when the inner control receives keyboard focus (`focus-visible`). Pairs with `focus-ring` to render the focus halo.
--input-group-focus-ringcolorvar(--ring)components.inputGroup.focusRingColor of the 3px focus halo painted around the wrapper when the inner control is focus-visible. Rendered at 50% opacity to soften the outer glow.
--input-group-invalid-ringcolorvar(--destructive)components.inputGroup.invalidRingSingle color driving the invalid state: the wrapper border uses it directly while the surrounding ring uses it at 20% (light) / 40% (dark) opacity.
--input-group-addon-labelcolorvar(--muted-foreground)components.inputGroup.addonLabelForeground color of inline addon content (icons, text, kbd) docked at the start or end of the group.
--input-group-text-labelcolorvar(--muted-foreground)components.inputGroup.textLabelForeground color of `InputGroupText` spans rendered inside the group (helper labels, separators).
--input-group-backdrop-blurblur0pxcomponents.inputGroup.backdropBlurBackdrop blur applied to the input-group surface. Set non-zero for a frosted-glass treatment.
Override in a theme
Authoring a theme is plain JSON. Drop overrides under
components.inputGroup, the names
are camelCase versions of the variable suffix.
{
"id": "my-theme",
"name": "My Theme",
"description": "...",
"accentSwatches": ["#000"],
"components": {
"inputGroup": {
"container": "var(--input-container)"
}
}
}
Then apply with applyTheme(myTheme)
(see the theming guide),
scope it to a subtree with themeToCssVars(myTheme, mode),
or consume any token directly in your own JSX with the matching Tailwind utility
(e.g. bg-input-group-…) — see the
chips on each token row.
API reference
Props specific to Input Group. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.
<InputGroup />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<InputGroupAddon />
1 prop- aligndefault
'inline-start''inline-start' | 'inline-end' | 'block-start' | 'block-end'Which edge the addon docks against.
<InputGroupButton />
2 props<InputGroupControlIdContext />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<InputGroupInput />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<InputGroupText />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<InputGroupTextarea />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.