{"id":19429576,"url":"https://github.com/codersuresh/toast-for-web","last_synced_at":"2026-05-18T19:34:30.643Z","repository":{"id":182237504,"uuid":"668186508","full_name":"coderSuresh/toast-for-web","owner":"coderSuresh","description":"Show toast messages in your web application easily, with a simple package.","archived":false,"fork":false,"pushed_at":"2024-01-02T03:29:03.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T07:17:29.837Z","etag":null,"topics":["frontend","npm","package","ui"],"latest_commit_sha":null,"homepage":"https://codersuresh.github.io/toast-for-web/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderSuresh.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-07-19T08:17:49.000Z","updated_at":"2023-07-25T16:32:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"d5df7a6f-05d0-4254-abf6-c55e844d793a","html_url":"https://github.com/coderSuresh/toast-for-web","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"b8a75b578e453130bf534e5c997ffff45676921f"},"previous_names":["codersuresh/web-toast","codersuresh/toast-for-web"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/coderSuresh/toast-for-web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderSuresh%2Ftoast-for-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderSuresh%2Ftoast-for-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderSuresh%2Ftoast-for-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderSuresh%2Ftoast-for-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderSuresh","download_url":"https://codeload.github.com/coderSuresh/toast-for-web/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderSuresh%2Ftoast-for-web/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274112808,"owners_count":25224331,"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-07T02:00:09.463Z","response_time":67,"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":["frontend","npm","package","ui"],"created_at":"2024-11-10T14:19:54.150Z","updated_at":"2026-05-18T19:34:30.609Z","avatar_url":"https://github.com/coderSuresh.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toast for Web\n\n[![npm version](https://badge.fury.io/js/toast-for-web.svg)](https://badge.fury.io/js/toast-for-web)\n[![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](https://opensource.org/licenses/MIT)\n\nShow toast messages in your web application easily, with a simple package.\n\nThat means, you can show an element with a message in your web application, which will disappear after a certain amount of time.\n\n## Features\n\n- Show toast messages in your web application easily\n- Show toast messages with different levels\n- Show toast messages with different durations\n- Click on the toast to dismiss it\n\n## Installation\n\n```bash\nnpm i toast-for-web\n```\n\n## Usage\n\n```js\nimport showToast from \"https://unpkg.com/toast-for-web@1.0.4/dist/index.js\";\nshowToast(message, level, duration);\n```\n\n## Parameters\n\n| Parameter | Type   | Description                                                        |\n| --------- | ------ | ------------------------------------------------------------------ |\n| message   | string | Message to show in the toast                                       |\n| level     | string | Level of the toast, can be `success`, `warning` or `error` |\n| duration  | number | Duration of the toast in milliseconds                              |\n\n## Example\n\n`index.html`\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"UTF-8\" /\u003e\n    \u003ctitle\u003eToast for Web\u003c/title\u003e\n    \u003c!-- CSS and JavaScript for the package --\u003e\n    \u003clink rel=\"stylesheet\" href=\"https://unpkg.com/toast-for-web@1.0.4/dist/style.css\" /\u003e\n    \u003cscript type=\"module\" src=\"index.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n\n  \u003cbody\u003e\n    \u003cbutton id=\"success-toast\"\u003eSuccess Toast\u003c/button\u003e\n    \u003cbutton id=\"warning-toast\"\u003eWarning Toast\u003c/button\u003e\n    \u003cbutton id=\"error-toast\"\u003eError Toast\u003c/button\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n`index.js`\n\n```js\nimport showToast from \"https://unpkg.com/toast-for-web@1.0.4/dist/index.js\";\n\nconst successToast = document.getElementById(\"success-toast\");\nconst warningToast = document.getElementById(\"warning-toast\");\nconst errorToast = document.getElementById(\"error-toast\");\n\ndocument.addEventListener(\"click\", (event) =\u003e {\n  if (event.target === successToast)\n    showToast(\"This is an info toast\", \"info\", 3000);\n\n  if (event.target === warningToast)\n    showToast(\"This is a warning toast\", \"warning\", 3000);\n\n  if (event.target === errorToast)\n    showToast(\"This is an error toast\", \"error\", 3000);\n});\n```\n\n## Demo\n\nView demo here: [Demo](https://codersuresh.github.io/toast-for-web/)\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n## Author\n \n[Coder Suresh](https://github.com/coderSuresh)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodersuresh%2Ftoast-for-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodersuresh%2Ftoast-for-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodersuresh%2Ftoast-for-web/lists"}