Make your AI a shadcn expert

Shadcn Input

React input for emails, search, and file uploads. Built with TypeScript and Tailwind CSS for Next.js using Base UI — labels, invalid state, and field groups.

The shadcn input is a styled native <input>. Focus it and type — the ring and file button come with the class. Use it for emails, names, search, and file picks. If the answer is a paragraph, that is a Textarea.

Scroll to load preview...

Looking for a neobrutalism version for shadcn?

Same input, thicker borders. The NeoBrutalism input is the kit if you want that look.

Usage

import { Input } from "@/components/ui/input"
<Input type="email" placeholder="Email" />

type picks the keyboard. disabled greys it out. aria-invalid is the red border.

Composition

Input

Pair it with Field for the label, hint, and error.

Basic

A bare input. The placeholder is the only hint.

Scroll to load preview...

Field

Field, FieldLabel, and FieldDescription — the label, the box, and the hint.

Scroll to load preview...

Field Group

FieldGroup stacks fields. Reset and submit sit on a horizontal Field.

Scroll to load preview...

Disabled

disabled on the input. data-disabled on Field so the label greys out with it.

Scroll to load preview...

Invalid

aria-invalid on the input. data-invalid on Field so the label goes red too.

Scroll to load preview...

File

type="file" — the native picker, same border as the rest.

Scroll to load preview...

Inline

orientation="horizontal" plus a Button. Search and go.

Scroll to load preview...

Grid

Two columns. First name and last name share a row.

Scroll to load preview...

Required

required on the input. Mark the label with a * so people see it before submit.

Scroll to load preview...

Badge

A Badge in the label — recommended, beta, optional.

Scroll to load preview...

Input Group

Icons and prefixes go in Input Group, not absolute-positioned on the input.

Scroll to load preview...

Button Group

Button Group joins the field and the action with no gap.

Scroll to load preview...

Form

Inside a Field on a real form. The label and the error stay with the input.

Scroll to load preview...

RTL

Wrap with DirectionProvider and dir="rtl". Labels stay Arabic.

Scroll to load preview...

API

Prop

Type

Every native <input> prop works — value, defaultValue, onChange, name, id.

Notes

Invalid needs two attributes

aria-invalid on the input, data-invalid on the Field. One without the other leaves the control or the label unstyled.

Prefixes and icons belong in Input Group, not absolute on the input.

With other components

Questions

Was this page helpful?

Sign in to leave feedback.