shadcn.io is not affiliated with official shadcn/ui
Label examples · Standard
Label with Badge for React
A label with a secondary badge that marks the setting as Beta.
Flag a field as Beta, Pro or New without changing its name. The Badge is a child of the Label, after Advanced Settings, so it sits on the caption's line and is read with it. Use it for experimental or paid settings.
Preview
Installation
FAQ
How is the Beta badge attached?
It is a child of Label, after the text Advanced Settings. Badge uses variant="secondary" and the text Beta.
What spaces the badge from the caption?
Label is a flex row with gap-2. The demo adds no margin of its own, so the badge sits on the same line as the text.
Which badge variant is this?
secondary. That is the only badge in the file. Omit variant when the status should use the default badge.
Does the badge block the setting?
No. The file is the label and the badge. It does not render an input, and it does not check a plan.
Related
- Required LabelA label with a destructive asterisk that
- Label with TooltipA label with an info button that opens a
- Badge with Text (Standard)A default badge with a short label for a
- Label with DescriptionA label with a line of muted helper text
- Error LabelA label in the destructive color with an
- Label with Character CountA label with a character count aligned to