Installation
npx logic2b@next add input-groupUsage
import {
InputGroup,
InputGroupAddon,
InputGroupInput,
InputGroupText,
} from "@/components/ui/input-group"
<InputGroup>
<InputGroupAddon>
<SearchIcon />
</InputGroupAddon>
<InputGroupInput placeholder="Search..." />
</InputGroup>
Examples
With Button
Textarea
280 characters left
Live playground
Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.
Generated JSX
<InputGroup
aria-label="Budget amount"
>
<InputGroupAddon>
<InputGroupText>€</InputGroupText>
</InputGroupAddon>
<InputGroupInput
type="text"
defaultValue="2,400"
aria-label="Amount"
placeholder="Monthly budget"
/>
<InputGroupAddon
align="inline-end"
>
<InputGroupText>EUR</InputGroupText>
</InputGroupAddon>
</InputGroup>API reference
Generated from the public TypeScript exports in src/ui/input-group.tsx.
InputGroup
ComponentProps: React.ComponentProps<"div">InputGroupAddon
ComponentProps: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
align | null | "inline-start" | "inline-end" | "block-start" | "block-end" | No | "inline-start" | — |
InputGroupButton
ComponentProps: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
type | "button" | "submit" | "reset" | No | "button" | — |
variant | null | "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | No | "ghost" | — |
size | null | "sm" | "xs" | "icon-xs" | "icon-sm" | No | "xs" | — |
InputGroupText
ComponentProps: React.ComponentProps<"span">InputGroupInput
ComponentProps: React.ComponentProps<"input">InputGroupTextarea
ComponentProps: React.ComponentProps<"textarea">Accessibility contract
Machine-readable behavior and consumer responsibilities for input-group.
- Support
- Composition contract
- Pattern
- composite input
Built-in semantics
- The inner native input/textarea keeps its semantics; decorative addons can be hidden from assistive technology.
Consumer responsibilities
- Label the inner control and give addon buttons accessible names.