Input Group
Installation
npx shadcn@latest add https://neonkit.heyaadi.com/r/input-group.jsonUsage
import {
InputGroup,
InputGroupAddon,
InputGroupInput,
InputGroupText,
} from "@/components/ui/input-group"
<InputGroup>
<InputGroupAddon>
<InputGroupText>https://</InputGroupText>
</InputGroupAddon>
<InputGroupInput aria-label="Domain" placeholder="acme.dev" />
</InputGroup>Examples
Search
The trailing addon swaps between a ⌘K hint, a spinner and a result count. ⌘K focuses the field.
Message box
A growing Textarea with a toolbar row below. Send only lights up once there's something to send.
Availability
aria-invalid on the control turns the group and its focus glow red.
API reference
InputGroup
The field box, a div with role="group". A click on anything but a button focuses the control.
| Prop | Type | Default |
|---|---|---|
size | "sm"32, 40 or 48px tall. Passed to the control. | "md" |
color | NeonColorColor of the focus glow. | inherited |
InputGroupAddon
Holds icons, text, buttons, a Kbd or a Spinner. Icons light up while the group has focus.
| Prop | Type | Default |
|---|---|---|
align | "inline-start"Before or after the control on its line, or a full-width row above or below it. | "inline-start" |
InputGroupInput
NeonKit's Input without its own box. Takes every Input prop except label, description, error, leading, trailing and size.
| Prop | Type | Default |
|---|---|---|
aria-invalid | booleanTurns the whole group red. | None |
InputGroupTextarea
NeonKit's Textarea without its own box. Grows with its content.
| Prop | Type | Default |
|---|---|---|
minRows | numberRows before it starts growing. | 2 |
maxRows | numberRows before it scrolls. | 10 |
InputGroupButton
A Button sized to sit inside the field. Takes every Button prop.
| Prop | Type | Default |
|---|---|---|
size | "sm"28px tall text button, or a 28px square. | "sm" |
variant | ButtonVariantAny Button variant. | "ghost" |
InputGroupText
Muted inline text, for prefixes, suffixes and units. Sits flush against the value.
| Prop | Type | Default |
|---|---|---|
className | stringMerged onto the span. | None |
Accessibility
- Label the control, not the group: a <label htmlFor> or aria-label on InputGroupInput.
- Addons are outside the input, so screen readers don't read a prefix as part of the value; mention it in the label when it matters.
- Use aria-invalid with aria-describedby pointing at the message, as in the availability example.