shadcn.io is not affiliated with official shadcn/ui
Alert Dialog examples · Custom Actions
Mixed Button Styles Alert Dialog for React
An alert dialog with Cancel on one side and two actions in different styles on the other.
When every button looks the same, people can't tell which one matters. This React alert dialog sets Cancel apart and pairs an outline Mark as On Hold with a solid Mark as Complete, so the recommended choice stands out. It's shadcn.io's Alert Dialog on Base UI with the Button variants doing the work.
Preview
Installation
FAQ
Which button gets which style?
The recommended action gets the default solid style, the alternative gets variant="outline", and Cancel keeps its outline look. Use variant="destructive" only for actions that destroy something.
Can I use other colors than the variants?
Prefer the variants, since they follow the theme in light and dark mode. If you need a green success button, check the variants first rather than adding raw color classes, which won't adapt to the theme.
How are the buttons grouped?
AlertDialogFooter takes sm:justify-between; Cancel sits on one side and the two actions share a flex gap-2 group on the other, so the layout reads as cancel versus act, then which act.
What happens on small screens?
The footer stacks its children, and the action group uses flex-col-reverse below sm, so every button is full width and the primary action ends up on top.
Related
- Vertical Button Stack Alert DialogAn alert dialog with its actions stacked
- Simple Confirmation Dialog Alert DialogA simple confirmation dialog with Cancel
- Actions with Icons Alert DialogAn alert dialog whose action carries an
- Simple Delete Confirmation Alert DialogA simple delete confirmation with a
- Simple Success Message Alert DialogA simple success dialog with one Continue
- Actions with Loading State Alert DialogAn alert dialog with file details whose