Launch sale — 60% off Pro
Contact
SonnerInteractive

Not affiliated with official shadcn/ui. Visit ui.shadcn.com for official docs.

React Sonner - Toast with Cancel Button

A Sonner toast notification with a cancel button for confirmations and dismissible warnings that need explicit user acknowledgment

Looking to implement shadcn/ui patterns?

Join our Discord community for help from other developers.


Sometimes users need to explicitly say no—not just dismiss. This React toast with cancel button gives confirmations a clear opt-out. Built with Sonner and shadcn/ui, the cancel prop adds an inline dismiss button—perfect for confirmation prompts, warning acknowledgments, optional actions, timeout warnings, or any notification where passive dismissal is ambiguous and you need users to actively confirm they understand or choose to cancel.

Pattern created by @haydenbleasel

Installation

Questions you might have