Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Checkbox examples · Standard

With Description Checkbox for React

A checkbox with a label and a line of description text that explains what the option does.

Framework
UI library

Some options need more than a few words. Here a Marketing emails checkbox has a muted sentence under its label saying what people will receive. FieldContent stacks the FieldLabel and FieldDescription, and the horizontal Field keeps the box aligned with the label's first line however far the description wraps. Use it for opt-ins, data sharing and other settings whose consequence is easy to miss.

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

When should I add description text to checkboxes?

When the label alone doesn't say what checking it means: what an email list will send, what data is shared, what a permission allows. If people would ask "what does this do?", add a description. Skip it for self-explanatory options like "Enable dark mode".

How long should description text be?

One or two short sentences. The description explains the consequence; it isn't a policy. Link to full terms when there is more to say, and keep each line quick to scan.

Why is the description muted?

FieldDescription uses text-muted-foreground at a smaller size, so the label reads first and the description second. The two levels let people decide from the label and read on only when they need the detail.

How does description text wrap on narrow screens?

It wraps like any paragraph, and the field caps the block at max-w-sm here. Because the field holds a FieldContent, it aligns its items to the start, so the checkbox stays level with the label instead of drifting to the middle of a tall block.

Can description text contain links or formatting?

Yes. It is ordinary text, so a link to the terms or privacy policy, or a strong for emphasis, works. Keep it static: people expect a description to explain the option, not to hold more controls.

Do screen readers announce description text?

The label is the checkbox's name; the description is ordinary text next to it, read when a screen reader moves through the page. To have it announced with the checkbox on focus, give the description an id and point the checkbox's aria-describedby at it.