Input Group
A unified input container with coordinated focus glow, animated addons, a blur-drift input, inline action buttons, and group invalid shake.
Customize
Installation
npx shadcn@latest add @kinetic/input-groupUsage
Compose the group from InputGroup, InputGroupAddon, and InputGroupInput.
import {
InputGroup,
InputGroupAddon,
InputGroupInput,
} from "@/components/kinetic/ui/input-group";
export function SearchField() {
return (
<InputGroup>
<InputGroupAddon>
<SearchIcon />
</InputGroupAddon>
<InputGroupInput placeholder="Search" aria-label="Search" />
</InputGroup>
);
}Addon position
InputGroupAddon takes align with inline-start (default), inline-end, block-start, or block-end. Use InputGroupText for plain text such as a prefix, unit, or live character counter.
<InputGroup>
<InputGroupAddon>
<InputGroupText>https://</InputGroupText>
</InputGroupAddon>
<InputGroupInput aria-label="Domain" />
<InputGroupAddon align="inline-end">
<InputGroupText>.com</InputGroupText>
</InputGroupAddon>
</InputGroup>Textarea composer
Use InputGroupTextarea inside InputGroup for multi-line inputs with spring autoResize (minRows, maxRows), blur-drift typing reveal, and block-start or block-end toolbar addons. Setting invalid or aria-invalid on InputGroupTextarea or InputGroupInput also propagates the error ring and micro-shake to the outer InputGroup.
import {
InputGroup,
InputGroupAddon,
InputGroupButton,
InputGroupText,
InputGroupTextarea,
} from "@/components/kinetic/ui/input-group";
<InputGroup>
<InputGroupTextarea autoResize placeholder="Write a prompt..." aria-label="Prompt" />
<InputGroupAddon align="block-end" className="justify-between">
<InputGroupText>Markdown supported</InputGroupText>
<InputGroupButton variant="primary">Send</InputGroupButton>
</InputGroupAddon>
</InputGroup>Action button
InputGroupButton renders an inline button with a variant of ghost (default), subtle, or primary. Provide an accessible label for icon-only buttons.
<InputGroup>
<InputGroupInput placeholder="Email" aria-label="Email" />
<InputGroupAddon align="inline-end">
<InputGroupButton variant="primary">Subscribe</InputGroupButton>
</InputGroupAddon>
</InputGroup>Sizes
Set size on InputGroup with sm, md, or lg. The input, addons, and buttons follow it.
<InputGroup size="lg">
<InputGroupInput aria-label="Large" />
</InputGroup>Invalid and disabled
invalid and disabled on InputGroup apply to the whole group, including the shake when the group becomes invalid.
<InputGroup invalid>
<InputGroupInput aria-label="Code" defaultValue="000" />
</InputGroup>Reveal tuning
blurPx, driftPx, and speed on InputGroup are shared with the input and control the typing reveal. InputGroupInput can override each of them. The reveal applies to type values text, search, email, url, and tel.
<InputGroup blurPx={6} driftPx={10} speed={1.5}>
<InputGroupInput aria-label="Tuned" />
</InputGroup>Motion preferences
The focus glow, addon motion, typing reveal, and shake respect the Kinetic reduced-motion setting and the browser preference. Durations use the current tempo and the speed prop.
API Reference
InputGroup
Zero-dependency container coordinating focus ring, inline/block addon layout, invalid micro-shake (including child invalid propagation), size, and blur-drift props.
| Prop | Type | Default | Description |
|---|---|---|---|
size / blurPx / driftPx / speed | "sm" | "md" | "lg" / number | "md" / 4 / 6 / 1 | Group height scale, typing blur radius (px), horizontal drift (px), and speed multiplier. |
invalid / disabled | boolean | false / false | Triggers group-wide invalid styling and micro-shake, or disables all nested controls. |
InputGroupAddon / InputGroupButton / InputGroupText
Inline or block addon slots, inline action buttons, and static text helpers.
| Prop | Type | Default | Description |
|---|---|---|---|
align (InputGroupAddon) | "inline-start" | "inline-end" | "block-start" | "block-end" | "inline-start" | Positions the addon at inline edges or stacked above/below a textarea control. |
variant (InputGroupButton) | "ghost" | "subtle" | "primary" | "ghost" | Visual emphasis for inline or toolbar action buttons. |
InputGroupInput / InputGroupTextarea
Borderless single-line input and spring auto-resizing textarea sharing focus, blur-drift mirror, and invalid propagation.
| Prop | Type | Default | Description |
|---|---|---|---|
autoResize / minRows / maxRows (Textarea) | boolean / number / number | true / 3 / 8 | Enables spring-damped height expansion between minRows and maxRows. |
blurPx / driftPx / speed / invalid / onValueChange | number / number / number / boolean / (value: string) => void | - | Per-control reveal overrides, child invalid propagation (shakes InputGroup), and string change callback. |