{"id":13421874,"url":"https://github.com/sweetalert2/sweetalert2-react-content","last_synced_at":"2025-05-14T04:07:38.443Z","repository":{"id":37601887,"uuid":"120148512","full_name":"sweetalert2/sweetalert2-react-content","owner":"sweetalert2","description":"Official SweetAlert2 enhancer adding support for React elements as content","archived":false,"fork":false,"pushed_at":"2025-04-20T12:24:59.000Z","size":2335,"stargazers_count":713,"open_issues_count":1,"forks_count":53,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-20T13:30:47.216Z","etag":null,"topics":["react","sweetalert","sweetalert2"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sweetalert2.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-04T02:30:26.000Z","updated_at":"2025-04-20T12:23:57.000Z","dependencies_parsed_at":"2023-02-08T06:30:48.941Z","dependency_job_id":"5da07341-0f2a-4bd2-8ff1-8c4ae5d69885","html_url":"https://github.com/sweetalert2/sweetalert2-react-content","commit_stats":{"total_commits":292,"total_committers":12,"mean_commits":"24.333333333333332","dds":0.6986301369863014,"last_synced_commit":"0f4c5ef6ab4adb4b8e7317a19cb6a3cdcd940d5d"},"previous_names":[],"tags_count":55,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetalert2%2Fsweetalert2-react-content","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetalert2%2Fsweetalert2-react-content/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetalert2%2Fsweetalert2-react-content/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sweetalert2%2Fsweetalert2-react-content/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sweetalert2","download_url":"https://codeload.github.com/sweetalert2/sweetalert2-react-content/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069219,"owners_count":22009512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","sweetalert","sweetalert2"],"created_at":"2024-07-30T23:00:33.265Z","updated_at":"2025-05-14T04:07:38.410Z","avatar_url":"https://github.com/sweetalert2.png","language":"JavaScript","funding_links":[],"categories":["UI Components","JavaScript","🌐 Web Development - Frontend"],"sub_categories":["Overlay","Dialog/Modal/Alert"],"readme":"# sweetalert2-react-content\n\nOfficial [SweetAlert2](https://sweetalert2.github.io/) enhancer adding support for React elements as content.\n\n- Simple example: https://sweetalert2.github.io/recipe-gallery/sweetalert2-react.html\n- With React Router: https://sweetalert2.github.io/recipe-gallery/sweetalert2-react-router.html\n- With react-day-picker: https://sweetalert2.github.io/recipe-gallery/input-datepicker.html\n\n---\n\nThe following options can be React elements:\n\n- `title`\n- `html`\n- `confirmButtonText`\n- `denyButtonText`\n- `cancelButtonText`\n- `footer`\n- `closeButtonHtml`\n- `iconHtml`\n- `loaderHtml`\n\n## Installation\n\n```bash\nnpm install sweetalert2 sweetalert2-react-content\n```\n\n## Usage Example\n\n```jsx\nimport Swal from 'sweetalert2'\nimport withReactContent from 'sweetalert2-react-content'\n\nconst MySwal = withReactContent(Swal)\n\nMySwal.fire({\n  title: \u003cp\u003eHello World\u003c/p\u003e,\n  didOpen: () =\u003e {\n    // `MySwal` is a subclass of `Swal` with all the same instance \u0026 static methods\n    MySwal.showLoading()\n  },\n}).then(() =\u003e {\n  return MySwal.fire(\u003cp\u003eShorthand works too\u003c/p\u003e)\n})\n```\n\nThe `dist/sweetalert2-react-content.umd.js` file defines `window.sweetalert2ReactContent` in non-CJS/AMD environments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsweetalert2%2Fsweetalert2-react-content","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsweetalert2%2Fsweetalert2-react-content","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsweetalert2%2Fsweetalert2-react-content/lists"}