プロジェクト
GitHubで見る
sweetalert2/sweetalert2-react-content
概要
React要素をコンテンツとして使えるようにする、SweetAlert2公式拡張機能
Web・アプリ開発計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 0
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルsweetalert2-react-content
Official SweetAlert2 enhancer adding support for React elements as content.
- Simple example: https://sweetalert2.github.io/recipe-gallery/sweetalert2-react.html
- With React Router: https://sweetalert2.github.io/recipe-gallery/sweetalert2-react-router.html
- With react-day-picker: https://sweetalert2.github.io/recipe-gallery/input-datepicker.html
The following options can be React elements:
titlehtmlconfirmButtonTextdenyButtonTextcancelButtonTextfootercloseButtonHtmliconHtmlloaderHtml
Installation
npm install 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>,
didOpen: () => {
// `MySwal` is a subclass of `Swal` with all the same instance & static methods
MySwal.showLoading()
},
}).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.
関連プロジェクトを探す
読み込み中…