Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Input examples · Standard

Input with Helper Text for React

An email field with helper text under it about how the address is used.

Framework
UI library

A short reassurance under a field answers the question people have before they type. This example puts We’ll never share your email with anyone else in a FieldDescription under the email input. Use helper text for privacy notes, format hints and anything people should know while they fill the field in.

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 is the line under the field?

A FieldDescription after the input, in smaller, muted text. Placed after the input, it reads as a note on what was typed rather than an instruction.

Why type email?

The browser checks the address format when the form is submitted, and mobile keyboards show the @ key. The placeholder you@example.com shows the expected shape.

When should the text go above the field instead?

When it changes what people will enter, such as what a username is for. The Description example puts it between the label and the input.

What about errors?

Keep the helper text for guidance and show problems in FieldError when the field is invalid, as the Error State example does.

Do screen readers read the helper text?

They reach it after the input in reading order. To have it read when the input gets focus, give it an id and set aria-describedby on the input to it.

How is Email tied to the field?

Clicking the label focuses the field, and screen readers announce it with the field. FieldLabel sets htmlFor to helper-email, the input's id.