shadcn.io is not affiliated with official shadcn/ui
Button examples · Destructive
Button with Right Icon (Destructive) for React
A destructive button with an arrow after the label, when a dangerous action continues on into another step of the flow.
Destructive color, the label, then an arrow. Use the arrow when delete is step one of a flow, not when the delete happens immediately.
Use it for Delete and continue, or Remove and review. If the click should just delete, drop the arrow and confirm in an Alert Dialog. In React, Base UI will not tell anyone the icon is an arrow.
Preview
Installation
FAQ
Why is the arrow after the label?
The destructive button ends with ArrowRightIcon and data-icon="inline-end". The arrow picks up the danger color, stays aria-hidden="true", and moves to the other side in a right-to-left layout.
Does the arrow mean this navigates?
No. The arrow is decorative. The control is still a button with type="button", so it doesn't open a URL and it doesn't submit a form unless you pass type="submit".
How do I use a different icon?
Replace ArrowRightIcon and keep data-icon="inline-end" if it should stay after the label. Use inline-start if it should lead. Leave aria-hidden="true" on while the text is enough.
What does destructive add to the arrow?
variant="destructive" paints a light danger fill and danger-colored text, and the arrow uses that same color. The arrow still doesn't mean the click is safe to repeat. Confirm a delete that can't be undone in an Alert Dialog.
Related
- Button with Left Icon (Destructive)An icon on a delete
- Button with Text (Destructive)Delete, in the danger color
- Button with Right Icon (Standard)An arrow on the main action
- Simple Delete Confirmation Alert DialogA simple delete confirmation with a
- Rounded Button (Destructive)A pill for a delete
- Breadcrumb with Ellipsis (Standard)A breadcrumb trail with a text Home link