@spectrum-web-components/alert-dialog
Web component implementation of a Spectrum design AlertDialog
by caseyisonitFree
Description
sp-alert-dialog is a web component from Spectrum Web Components, Adobe's implementation of its Spectrum design system as custom elements. It shows an alert dialog, which displays important information that users must acknowledge before they continue. The docs describe its anatomy: every alert dialog needs a title, set with a heading slot, that uses a few words to say what will happen if the user continues, plus an optional description in the default slot, and action buttons in a button slot that let the user respond. The element uses a slot-based API, so you can customize the content of the overlay. The package is installed with yarn or npm as @spectrum-web-components/alert-dialog, and you import the side-effect registration of the element. If you need the base class for typing or for extending it, the docs show how to import AlertDialog from the package. The page has sections for options, behaviors and accessibility, a changelog of patch releases, and links to a Storybook and a StackBlitz example. The current npm version shown on the page is 1.12.5.…
Highlights
- Alert dialog custom element for web apps
- Slot-based API for title, description and buttons
- Accessibility guidance in the docs
- Storybook and StackBlitz examples
- Changelog of patch releases
Ratings & Reviews
No ratings yet
Be the first to rate @spectrum-web-components/alert-dialog.
People also visit

@tabworthy/components
Small, accessible datepicker and datetimepicker Web Components
@spectrum-web-components/alert-dialog FAQ
What is sp-alert-dialog?
A web component from Spectrum Web Components that shows an alert dialog asking users to acknowledge important information.
How do I install it?
The docs say to add @spectrum-web-components/alert-dialog with yarn or your package manager, then import the sp-alert-dialog file.
What does an alert dialog need?
The docs say every alert dialog must have a title in the heading slot. A description goes in the default slot, and buttons go in the button slot.
Where can I see it in action?
The page links a Storybook and a StackBlitz example.
What are the best @spectrum-web-components/alert-dialog alternatives?
Popular alternatives to @spectrum-web-components/alert-dialog include sweetalert2, react-modal and Spectrum UI. See all @spectrum-web-components/alert-dialog alternatives













