{"id":22332826,"url":"https://github.com/craftkit/craft-widget-toast","last_synced_at":"2026-07-02T22:33:28.918Z","repository":{"id":60129847,"uuid":"541083094","full_name":"craftkit/craft-widget-toast","owner":"craftkit","description":"Toast is a Craft-UIKit component that provides a simple way to display a message to the user.","archived":false,"fork":false,"pushed_at":"2022-10-28T05:58:48.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-15T10:41:56.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/craftkit.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}},"created_at":"2022-09-25T06:58:46.000Z","updated_at":"2022-09-25T08:26:15.000Z","dependencies_parsed_at":"2023-01-20T18:30:39.604Z","dependency_job_id":null,"html_url":"https://github.com/craftkit/craft-widget-toast","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/craftkit/craft-widget-toast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftkit%2Fcraft-widget-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftkit%2Fcraft-widget-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftkit%2Fcraft-widget-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftkit%2Fcraft-widget-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/craftkit","download_url":"https://codeload.github.com/craftkit/craft-widget-toast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftkit%2Fcraft-widget-toast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35065702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"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":[],"created_at":"2024-12-04T04:19:59.908Z","updated_at":"2026-07-02T22:33:28.879Z","avatar_url":"https://github.com/craftkit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toast for Craft-UIKit\n\nToast is a Craft-UIKit component that provides a simple way to display a message to the user. It is a non-intrusive message that appears on the screen for a short period of time and then disappears.\n\nAfter duration time passed, callback will be called if it is provided. At this point, content of the toast will be `unloadView()`ed, but the toast itself will remain in the DOM, so you can use it again.\n\n## Installation\n\n```bash\nnpm install @craftkit/craft-widget-toast\n```\n\n## Usage\n\n```js\nimport * as Craft from \"@craftkit/craft-uikit\";\nimport * as Toast from \"@craftkit/craft-widget-toast\";\nCraft.usePackage(Toast);\n\nclass Page extends Craft.UI.View {\n  toast() {\n    const toast = new Craft.Widget.Toast();\n    Craft.Core.Context.getRootViewController().appendView(toast);\n    toast.show({\n      message: \"Hello World!\",\n      callback: () =\u003e {\n        toast.removeFromParent();\n        toast.unloadView();\n      }\n    });\n  }\n\n  template(componentId) {\n    return `\n      \u003cdiv id=\"root\"\u003e\n        \u003cbutton onclick=\"${componentId}.toast()\"\u003eToast\u003c/button\u003e\n      \u003c/div\u003e\n    `;\n  }\n}\n```\n\n## API\n\n### `Toast#show(options)`\n\nDisplays a toast message.\n\n#### Arguments\n\n- `options` (`string` | `object`): The message to display or an object with the following properties:\n  - `title` (`string`): The title of the toast message.\n  - `message` (`string`): The message to display.\n  - `color` (`string`): The color of the toast message.\n  - `opacity` (`number`): The opacity of the toast message.\n  - `duration` (`number`): The duration in milliseconds to display the toast message. Defaults to `3000`.\n  - `callback` (`function`): A callback function to execute when the toast message is dismissed.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraftkit%2Fcraft-widget-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcraftkit%2Fcraft-widget-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraftkit%2Fcraft-widget-toast/lists"}