shadcn.io is not affiliated with official shadcn/ui
Alert Dialog examples · Custom Actions
Vertical Button Stack Alert Dialog for React
An alert dialog with its actions stacked vertically at full width.
More than two actions get cramped side by side. This React alert dialog stacks Edit, Duplicate, Share and Cancel vertically, each at full width, like an action sheet. It's shadcn.io's Alert Dialog on Base UI with the footer set to a column at every size.
Preview
Installation
FAQ
When should I stack buttons vertically?
With three or more actions, or labels too long to sit side by side. Two short buttons like Cancel and Confirm fit fine in a row.
How is the stack made?
AlertDialogFooter takes flex-col sm:flex-col, which overrides its row layout on wide screens. The buttons stretch to full width, with the footer's own gap between them.
What order should stacked buttons follow?
The main action on top, other actions below, and Cancel last, so the safe way out is always in the same place.
Should all the buttons look the same?
No. The main action keeps the solid style and the others use variant="outline", so the recommended choice is easy to spot.
Related
- Mixed Button Styles Alert DialogAn alert dialog with Cancel on one side
- Split Actions Layout Alert DialogAn alert dialog with a secondary action
- Simple Confirmation Dialog Alert DialogA simple confirmation dialog with Cancel
- Actions with Icons Alert DialogAn alert dialog whose action carries an
- Actions with Loading State Alert DialogAn alert dialog with file details whose
- Confirmation with Centered Icon Alert DialogA confirmation dialog with a large icon