Input group
Joins an input with a prefix, suffix, or action.
input-group-basic-demo.tsx
Installation
The CLI adds the files, packages, theme variables, and Tailwind plugin that this component uses. Before you run it, set up your project.
npm
yarn
pnpm
bun
Composition
TextField or TextAreaOwns the label and validation state. Install it separately.
InputGroupInputGroupInputUse it in TextField.
InputGroupTextAreaUse it in TextArea.
InputGroupAddonRepeatsInputGroupButtonOptionalFits inside the field edge at each size.
Icon
input-group-icon-demo.tsx
Text area
Set align="block-end" on InputGroupAddon to add a row below the text.
Keep the decision in one place.
input-group-notes-demo.tsx
Disabled
Set isDisabled on the TextField. InputGroup inherits the state.
input-group-disabled-demo.tsx
Invalid
Set isInvalid on the TextField. InputGroup inherits the state.
This domain is already taken.
input-group-invalid-demo.tsx
Sizes
Set size on the TextField. The group and its icon use it.
input-group-sizes-demo.tsx
API reference
vip/ui adds or changes the props below. For all other props, see React Aria Group (opens in a new tab).
InputGroup
- size: "xs" | "sm" | "md" | "lg" | "xl" = "lg"
- Sets the size of the group. Without a size, the group uses the size of its parent field.
InputGroupAddon
- align: "inline" | "block-end" = "inline"
- Place text, an icon, or a button beside the input, or in a full-width row below a textarea.