View fulldotdev/ui on GitHub

Input

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

Installation

npx shadcn@latest add @fulldev/input

Usage

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

Basic

Field

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

Field Group

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

Disabled

Use the disabled prop to disable the input.

Invalid

Use the aria-invalid prop to mark the input as invalid.

File

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

Inline

Use Field with orientation="horizontal" to create an inline input.

Grid

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

Required

Use the required attribute to indicate required inputs.

Badge

Use Badge in the label to highlight a recommended field.

Input Group

To add icons, text, or buttons inside an input, use the InputGroup component.

Button Group

To add buttons to an input, use the ButtonGroup component.

Form

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

RTL

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

API Reference

Source: react/src/components/ui/input.tsx