Input

A text input component for forms and user data entry with built-in styling and accessibility features.

Loading example…

Installation

bunx --bun shadcn@latest add @sui/input

Install with the shadcn CLI or use the shared @workspace/ui package. Follow the installation guide to configure the registry, load styles, and choose import aliases.

Usage

import { Input } from "@workspace/ui/components/input"
<Input />

Basic

Loading example…

Field

Use Field, FieldLabel, and FieldDescription to create an input with a label and description.

Loading example…

Field Group

Use FieldGroup to show multiple Field blocks and to build forms.

Loading example…

Disabled

Use the disabled prop to disable the input. To style the disabled state, add the data-disabled attribute to the Field component.

Loading example…

Invalid

Use the aria-invalid prop to mark the input as invalid. To style the invalid state, add the data-invalid attribute to the Field component.

Loading example…

File

Use the type="file" prop to create a file input.

Loading example…

Inline

Use Field with orientation="horizontal" to create an inline input. Pair with Button to create a search input with a button.

Loading example…

Grid

Use a grid layout to place multiple inputs side by side.

Loading example…

Required

Use the required attribute to indicate required inputs.

Loading example…

Badge

Use Badge in the label to highlight a recommended field.

Loading example…

Input Group

To add icons, text, or buttons inside an input, use the InputGroup component. See the Input Group component for more examples.

Loading example…

Button Group

To add buttons to an input, use the ButtonGroup component. See the Button Group component for more examples.

Loading example…

Form

A full form example with multiple inputs, a select, and a button.

Loading example…

RTL

To enable RTL support in shadcn/ui, see the RTL configuration guide.

Loading example…