shadcn.io is not affiliated with official shadcn/ui
Checkbox examples · Standard
With Subtitle and Description Checkbox for React
A checkbox with a Recommended subtitle beside its label and a description underneath.
Important settings sometimes need both a nudge and a reason. Here Security alerts has a muted Recommended beside the label and a sentence underneath about what the alerts cover. FieldContent stacks a baseline-aligned row (label and subtitle) over the FieldDescription, and the horizontal Field keeps the box level with the label. Use it for the few settings where both a recommendation and an explanation help people decide.
Preview
Installation
FAQ
When should I use both subtitle and description?
When an option needs a quick qualifier and an explanation: the subtitle is the nudge (Recommended), the description is the reason. Keep it for settings that matter, like security or billing. Use only the subtitle, or only the description, when the other line would repeat it.
How does visual hierarchy work with subtitle and description?
The label is full-strength text, the subtitle is muted on the same line, and the description is muted on its own line below. People read the option's name first, then the qualifier, then the detail if they want it.
Do subtitle and description work well on mobile?
Yes, but each option takes more height. In a long list that adds scrolling, so give the full treatment only to the options that need it and keep the rest to a label.
How do I avoid subtitle and description saying the same thing?
Make the subtitle a category (Recommended, Optional, Pro) and the description the explanation. "Recommended" over "This is recommended" says nothing new; "Recommended" over what the alerts protect against does.
Related
- With Subtitle CheckboxA checkbox whose label has a short muted
- With Description CheckboxA checkbox with a label and a line of
- Simple CheckboxA checkbox with a label for a single
- Checkbox with Description FieldA checked checkbox with a label and a
- Switch with DescriptionA switch with a label and a line of
- Nested List CheckboxA select-all checkbox over three indented