āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/sadmann7/diceui/components/input-group ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
npx shadcn@latest add "https://diceui.com/r/input-group"
```package-install
class-variance-authority
```
</Step>
<Step>
Copy and paste the following code into your project.
<ComponentSource name="input-group" />
</Step>
</Steps>
Import the component and use it with different position props.
import { InputGroup, InputGroupItem } from "@/components/ui/input-group";
<InputGroup>
<InputGroupItem position="first" placeholder="First" />
<InputGroupItem position="middle" placeholder="Middle" />
<InputGroupItem position="last" placeholder="Last" />
</InputGroup>
Use grouped inputs for structured form data like phone numbers or addresses.
<ComponentTabs name="input-group-form-demo" />Create color input controls using grouped inputs for RGB values.
<ComponentTabs name="input-group-rgb-demo" />Display input groups in a vertical orientation.
<ComponentTabs name="input-group-vertical-demo" />The main input group container component.
<AutoTypeTable path="./types/docs/input-group.ts" name="InputGroupRootProps" />
Individual input items within the input group.
<AutoTypeTable path="./types/docs/input-group.ts" name="InputGroupItemProps" />
The component supports all standard HTML input attributes and properties from the base Input component, plus the following:
first: Removes right border radius, maintains left bordermiddle: Removes all border radius, removes left border to prevent doublinglast: Removes left border radius, removes left border to prevent doublingisolated: Normal input styling (default)The component automatically handles:
The InputGroup component follows standard web accessibility practices. Users navigate between inputs using Tab and Shift+Tab keys, which is the expected behavior for form controls.
<KeyboardShortcutsTable shortcuts={[ { keys: ["Tab"], description: "Moves focus to the next input in the group.", }, { keys: ["Shift", "Tab"], description: "Moves focus to the previous input in the group.", }, ]} />
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā