
Description
sweetalert2-react-content is the official enhancer for SweetAlert2, the library for showing alert dialogs in the browser. It lets you pass React elements as content, so a popup can use your own components and markup instead of plain text. The README lists the options that accept React elements: title, html, the confirm, deny and cancel button texts, footer, the close button, the icon and the loader. Each of these can be a React element while the rest of SweetAlert2 works as usual. The README links three recipe examples: a simple React dialog, one that works with React Router, and one that uses a date picker from react-day-picker. The package is installed alongside SweetAlert2, following the installation steps in the README. A UMD build is included for pages that do not use CommonJS or AMD, and it defines window.sweetalert2ReactContent in those environments. The source is public on GitHub under the sweetalert2 organization. It is a small add-on for developers who already use SweetAlert2 in a React app.…
Highlights
- React elements as popup title, text and buttons
- Works with footer, icon and loader options
- Recipes for React Router and date pickers
- UMD build for browser use
Ratings & Reviews
No ratings yet
Be the first to rate sweetalert2-react-content.
People also visit

react-notifications-component
React component for creating notifications on the fly
sweetalert2-react-content FAQ
What is sweetalert2-react-content?
An add-on for SweetAlert2 that lets its popup content be React elements.
Which options accept React elements?
The README lists title, html, confirmButtonText, denyButtonText, cancelButtonText, footer, closeButtonHtml, iconHtml and loaderHtml.
Do I need SweetAlert2 as well?
Yes. This package enhances SweetAlert2, which is the library that shows the dialogs.
Are there examples?
The README links three recipes: a simple example, one that uses React Router and one that uses react-day-picker.
Is there a browser build?
Yes. The UMD file defines window.sweetalert2ReactContent when the page is not using CommonJS or AMD.
What are the best sweetalert2-react-content alternatives?
Popular alternatives to sweetalert2-react-content include sweetalert2, react-modal and react-alert. See all sweetalert2-react-content alternatives
















