Skip to content
shadcn.io
shadcn.io is not affiliated with official shadcn/ui

Shadcn Input for React and Tailwind

A field that allows users to enter text.

Installation

bunx --bun shadcn@latest add https://kit.dev/r/input.json

Usage

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

Controlled

Control the value with value and onChange.

States

Disabled

Use the disabled prop to disable the input.

Invalid

Use the invalid prop to mark the input as invalid.

Sizes

Use the size prop to change the input height.

Small

Medium

Large

Examples

With Field

Use Field components to create an input with a label and a description.

Field Group

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

File

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

Inline

Use the orientation="horizontal" prop to create an inline input.

Grid

Badge

Use Badge in the label to highlight a recommended field.

Input Group

Use InputGroup to create an input group.

Button Group

Use ButtonGroup to create a button group.

API Reference

Input

Text input. Accepts all native input attributes.

PropTypeDefault
size"sm" | "md" | "lg""md"
typestringtext
classNamestring-

For a complete list of props, see the Ark UI documentation.