Input

Loading...

Installation

Add the component with the CLI.

npx shadcn@latest add @intentui/input

Manual installation

Install the dependencies, then copy the component source into your project.

npm install react-aria-components

Anatomy

import { Input } from "@/components/ui/input";

<Input/>

Examples

Input group

Use InputGroup to add prefix or suffix content. Icons receive spacing automatically. For Text content, set --input-gutter-start or --input-gutter-end to reserve enough space on the corresponding side.

Loading...

Label and description

Use a label to name the input and a description to provide instructions.

Loading...

Text field

For a standalone input, match its id to the label’s htmlFor. TextField associates its label, input, and description automatically.

Loading...

You can learn more in the TextField documentation.

Controlled

Pass value and update it with onChange to control the input.

Loading...

Component API

Input

Input extends the React Aria Components <Input> component.

classNamestring

InputGroup

InputGroup extends the React Aria Components <Group> component.

classNamestring

See the React Aria for the full API reference.

Design