Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Field examples · Layouts

Vertical Layout (Default) Field for React

Two stacked fields, each with its label above and a description below.

Framework
UI library

The default layout: no orientation, so each Field stacks its label, its input and a FieldDescription. It reads top to bottom and works at any width.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

What makes this layout vertical?

Neither Field sets orientation, so both stay at the default vertical. The label stacks over the input, and FieldDescription follows the input.

What does each description say?

Name's description reads This will be displayed publicly. Email's description reads We'll never share your email.

What are the two inputs?

Name is type text with placeholder Your name. Email is type email with placeholder you@example.com.

How do the labels connect?

Each FieldLabel inside its Field names that input. The labels are Name and Email.

What does FieldGroup do here?

FieldGroup stacks the two fields in one column, capped with max-w-md. There is no FieldSet and no legend.

How do I put a label beside its input?

Set orientation to horizontal on that Field. Leave it unset to keep the stack this demo uses.