Popularity
2.9
Growing
Activity
6.1
Declining
222
8
13

Monthly Downloads: 0
Programming language: JavaScript
Tags: UI Components     Overlay    
Latest version: v3.0.1

sweetalert2-react-content alternatives and similar libraries

Based on the "Overlay" category

Do you think we are missing an alternative of sweetalert2-react-content or a related project?

Add another 'Overlay' Library

README

sweetalert2-react-content

Official SweetAlert2 enhancer adding support for React elements as content.

Build Status Coverage Status npm version

semantic-release badge typescript .d.ts included License: MIT

The following options can be React elements:

  • title
  • html
  • confirmButtonText
  • cancelButtonText
  • footer

Installation

npm install --save sweetalert2 sweetalert2-react-content

Usage Example

import Swal from 'sweetalert2'
import withReactContent from 'sweetalert2-react-content'

const MySwal = withReactContent(Swal)

MySwal.fire({
  title: <p>Hello World</p>,
  footer: 'Copyright 2018',
  onOpen: () => {
    // `MySwal` is a subclass of `Swal`
    //   with all the same instance & static methods
    MySwal.clickConfirm()
  }
}).then(() => {
  return MySwal.fire(<p>Shorthand works too</p>)
})

The dist/sweetalert2-react-content.umd.js file defines window.sweetalert2ReactContent in non-CJS/AMD environments.


*Note that all licence references and agreements mentioned in the sweetalert2-react-content README section above are relevant to that project's source code only.