shadcn.io is not affiliated with official shadcn/ui
Collapsible examples · Outline
Warning Outline Collapsible for React
A warning-tinted box with a warning icon, a title and a hint line that expands to the details.
A warning that asks for a closer look. The box is tinted and outlined with the theme's warning color, the trigger shows a warning icon, the title Warning and a muted hint, and the details open under a divider. Use it before risky actions or next to settings with side effects.
Preview
Installation
FAQ
Which classes paint the warning box?
Collapsible uses border-2 border-warning/32 bg-warning/4: a faint tint and a stronger border from the theme's --warning color, the same mix as a warning Alert. The icon is text-warning.
Where does Click to view details come from?
It's the second line of the trigger, text-muted-foreground text-sm under the Warning title, in a flex-1 column beside the icon.
Does the answer keep the warning border?
Yes. CollapsibleContent has border-t-2 border-warning/32, and the details are text-muted-foreground text-sm.
Related
- Info Box Outline CollapsibleAn info-tinted box with an info icon and
- Outlined CollapsibleA box with a thick outline and a System
- Warning with Title AlertA warning alert with only a title, for a
- Card with Badge CollapsibleA card whose Premium Features header
- Simple Delete Confirmation Alert DialogA simple delete confirmation with a
- FAQ with Icon CollapsibleAn FAQ question in a bordered box, led by