shadcn.io is not affiliated with official shadcn/ui
Alert Dialog examples · Form
Form with Description Alert Dialog for React
An alert dialog with one labeled input and helper text under it.
A label alone doesn't always say what good input looks like. This React alert dialog asks for an API key name and adds helper text under the input. It's shadcn.io's Alert Dialog on Base UI with an Input in a Field and its FieldDescription.
Preview
Installation
FAQ
What should the helper text say?
What helps people get it right: purpose, format or limits. Use a name that describes where this key will be used beats repeating the label.
Helper text or placeholder?
Both. The placeholder shows an example, Production API Key, and disappears as people type; the description stays visible, so put requirements there.
How long should it be?
One short sentence. If it needs more, the input is probably too complex for a dialog.
How is the field built?
A Field with FieldLabel, the Input and a FieldDescription under it. The field ties the label and description to the input, so screen readers announce both.
Related
- Single Input Dialog Alert DialogAn alert dialog with one prefilled input
- Form with Validation State Alert DialogAn alert dialog whose input shows an
- Input with LabelA text input with a label above it
- Multiple Inputs Dialog Alert DialogAn alert dialog with a subject input and
- Required LabelA label with a destructive asterisk that
- Simple Confirmation Dialog Alert DialogA simple confirmation dialog with Cancel