shadcn.io is not affiliated with official shadcn/ui
Alert Dialog examples · Form
Form with Checkboxes Alert Dialog for React
An alert dialog with checkboxes, each with a description, for choosing which notifications to receive.
Some choices aren't exclusive: people can want email and push but not SMS. This React alert dialog lists three notification channels as checkboxes, each with a one-line description. It's shadcn.io's Alert Dialog on Base UI with Checkbox and Field parts.
Preview
Installation
FAQ
Checkboxes or radio buttons?
Checkboxes for independent choices, where any combination is valid. Radio buttons when picking one should rule out the others, as in Form with Radio Group.
Should some boxes start checked?
Check the options most people want, here email and push, to save them clicks. Leave anything privacy-related or marketing unchecked so it stays opt-in.
How is each row built?
A horizontal Field holds the Checkbox and a FieldContent with FieldLabel and FieldDescription, inside a FieldGroup. The field aligns the checkbox with the first line of text when the description wraps.
How long should each description be?
One short sentence that says what checking it means. Longer explanations belong on a settings page.
Related
- Form with Radio Group Alert DialogAn alert dialog with a radio group of
- Simple CheckboxA checkbox with a label for a single
- Multiple Inputs Dialog Alert DialogAn alert dialog with a subject input and
- Destructive with Checkbox Confirmation Alert DialogA destructive dialog whose delete action
- Single Input Dialog Alert DialogAn alert dialog with one prefilled input
- Standard DialogA share dialog with a read-only link, a