{"id":30770514,"url":"https://github.com/sanand0/bootstrap-alert","last_synced_at":"2026-01-20T17:27:07.935Z","repository":{"id":300992097,"uuid":"1007850130","full_name":"sanand0/bootstrap-alert","owner":"sanand0","description":"A lightweight Bootstrap toast notification alternative to alert()","archived":false,"fork":false,"pushed_at":"2025-07-31T05:55:35.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-30T13:54:53.165Z","etag":null,"topics":["library"],"latest_commit_sha":null,"homepage":"https://sanand0.github.io/bootstrap-alert/","language":"HTML","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/sanand0.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2025-06-24T16:16:30.000Z","updated_at":"2025-07-31T05:55:38.000Z","dependencies_parsed_at":"2025-06-24T16:39:15.224Z","dependency_job_id":"3d35ca07-abee-4c71-88a2-4d10e91b68f8","html_url":"https://github.com/sanand0/bootstrap-alert","commit_stats":null,"previous_names":["sanand0/bootstrap-alert"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sanand0/bootstrap-alert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanand0%2Fbootstrap-alert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanand0%2Fbootstrap-alert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanand0%2Fbootstrap-alert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanand0%2Fbootstrap-alert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanand0","download_url":"https://codeload.github.com/sanand0/bootstrap-alert/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanand0%2Fbootstrap-alert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273685604,"owners_count":25149722,"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","status":"online","status_checked_at":"2025-09-04T02:00:08.968Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["library"],"created_at":"2025-09-04T23:08:58.991Z","updated_at":"2026-01-20T17:27:07.892Z","avatar_url":"https://github.com/sanand0.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bootstrap-alert\n\n[![npm version](https://img.shields.io/npm/v/bootstrap-alert.svg)](https://www.npmjs.com/package/bootstrap-alert)\n[![Bootstrap](https://img.shields.io/badge/Framework-Bootstrap%205-7952b3)](https://getbootstrap.com/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![bundle size](https://img.shields.io/bundlephobia/minzip/bootstrap-alert)](https://bundlephobia.com/package/bootstrap-alert)\n\nA lightweight [Bootstrap 5](https://getbootstrap.com/docs/5.3/) toast notification library that provides a modern alternative to `alert()`.\n\n## Installation\n\nAdd this to your script:\n\n```js\nimport { bootstrapAlert } from \"bootstrap-alert\";\n```\n\nTo use via CDN, add this to your HTML file:\n\n```html\n\u003cscript type=\"importmap\"\u003e\n  {\n    \"imports\": {\n      \"bootstrap-alert\": \"https://cdn.jsdelivr.net/npm/bootstrap-alert@1\"\n    }\n  }\n\u003c/script\u003e\n```\n\nTo use locally, install via `npm`:\n\n```bash\nnpm install bootstrap-alert\n```\n\n... and add this to your HTML file:\n\n```html\n\u003cscript type=\"importmap\"\u003e\n  {\n    \"imports\": {\n      \"bootstrap-alert\": \"./node_modules/bootstrap-alert/dist/bootstrap-alert.js\"\n    }\n  }\n\u003c/script\u003e\n```\n\n## Usage\n\n```js\nimport { bootstrapAlert } from \"https://cdn.jsdelivr.net/npm/bootstrap-alert@1\";\n\n// Simple toast\nbootstrapAlert(\"Simple message\");\n\n// Custom toast: with title and color\nbootstrapAlert({ title: \"Success\", body: \"Custom toast message\", color: \"success\" });\n\n// Replace toast: clears previous ones\nbootstrapAlert({ body: \"This replaces previous toast\", replace: true });\n\n// Bottom left position\nbootstrapAlert({ title: \"Position\", body: \"Bottom start\", position: \"bottom-0 start-0\" });\n\n// Top right position\nbootstrapAlert({ title: \"Position\", body: \"Bottom start\", position: \"top-0 end-0\" });\n\n// HTML toast: with icons / formatting\nbootstrapAlert({ title: '\u003ci class=\"bi bi-cake2\"\u003e\u003c/i\u003e Congts!', body: \"Well \u003cu\u003edone\u003c/u\u003e!\" });\n\n// Don't hide: Keep toast on screen until dismissed\nbootstrapAlert({ body: \"Stays on screen\", autohide: false });\n\n// Quick hide: Change the delay before timeout\nbootstrapAlert({ body: \"Vanishes quickly\", delay: 500 });\n```\n\n[](bootstrap-alert.html \":include\")\n\n## API\n\n`bootstrapAlert(options)` creates and displays a Bootstrap toast notification.\n\n| Option      | Type    | Default       | Description                                                       |\n| ----------- | ------- | ------------- | ----------------------------------------------------------------- |\n| `body`      | string  | required      | Toast message text/HTML                                           |\n| `title`     | string  |               | Toast header text/HTML                                            |\n| `color`     | string  |               | Bootstrap color variant (primary, success, danger, warning, info) |\n| `replace`   | boolean | false         | If true, replaces previous toasts; else, appends toast            |\n| `position`  | string  | 'top-0 end-0' | Toast position `{top/start/bottom/end}-{0/50/100}`. Persists      |\n| `delay`     | number  | 5000          | Delay in milliseconds before hiding the toast                     |\n| `autohide`  | boolean | true          | Automatically hide the toast after the delay                      |\n| `animation` | boolean | true          | Apply a CSS fade transition to the toast                          |\n\nThrows:\n\n- `Error` if Bootstrap 5 is not loaded\n- `Error` if body parameter is not provided\n\n## Development\n\n```bash\ngit clone https://github.com/sanand0/bootstrap-alert.git\ncd bootstrap-alert\n\nnpm install\nnpm run lint \u0026\u0026 npm run build \u0026\u0026 npm test\n\nnpm publish\ngit commit . -m\"$COMMIT_MSG\"; git tag $VERSION; git push --follow-tags\n```\n\n## Release notes\n\n- [1.1.1](https://npmjs.com/package/bootstrap-alert/v/1.1.1): 31 Jun 2025. Standardized package.json \u0026 README.md\n- [1.0.0](https://npmjs.com/package/bootstrap-alert/v/1.0.0): 25 Jun 2025. Initial release\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanand0%2Fbootstrap-alert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanand0%2Fbootstrap-alert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanand0%2Fbootstrap-alert/lists"}