{"id":13432647,"url":"https://github.com/egoist/native-toast","last_synced_at":"2025-04-07T12:10:25.972Z","repository":{"id":45275246,"uuid":"59740022","full_name":"egoist/native-toast","owner":"egoist","description":"Native-like toast notification but for the web.","archived":false,"fork":false,"pushed_at":"2022-05-09T13:16:01.000Z","size":164,"stargazers_count":150,"open_issues_count":3,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T19:42:07.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://native-toast.egoist.sh","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/egoist.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}},"created_at":"2016-05-26T10:01:18.000Z","updated_at":"2024-03-19T10:29:25.000Z","dependencies_parsed_at":"2022-09-14T05:02:11.531Z","dependency_job_id":null,"html_url":"https://github.com/egoist/native-toast","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fnative-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fnative-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fnative-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fnative-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egoist","download_url":"https://codeload.github.com/egoist/native-toast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648977,"owners_count":20972945,"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":[],"created_at":"2024-07-31T02:01:14.637Z","updated_at":"2025-04-07T12:10:25.951Z","avatar_url":"https://github.com/egoist.png","language":"HTML","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# native-toast [![NPM version](https://badgen.net/npm/v/native-toast)](https://npmjs.com/package/native-toast) [![NPM downloads](https://badgen.net/npm/dm/native-toast)](https://npmjs.com/package/native-toast)\n\n\u003e Native-like toast notification but for the web. (JS + CSS ≈ 4KB)\n\n## Install\n\n```bash\n$ npm install --save native-toast\n```\n\nNPMCDN: https://unpkg.com/native-toast/dist/\n\n## Usage\n\nFirst import `native-toast/dist/native-toast.css`, then:\n\n```js\nimport nativeToast from 'native-toast'\n\nnativeToast({\n  message: 'wait wait!',\n  position: 'north-east',\n  // Self destroy in 5 seconds\n  timeout: 5000,\n  type: 'warning'\n})\n// or nativeToast.warning(options)\n```\n\nFour types: `success` `warning` `info` `error`\n\n## API\n\n### nativeToast(options)\n\n#### options\n\n##### message\n\nType: `string`\u003cbr\u003e\nDefault: `''`\n\nToast message.\n\n##### position\n\nType: `string`\u003cbr\u003e\nDefault: `south-east`\u003cbr\u003e\nValues: `center` `west` `east` `south` `south-west` `south-east` `north` `north-west` `north-east`\n\nToast position.\n\n##### rounded\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nSet `border-radius` to `33px` instead of `3px`. Has no effect when `edge === false`.\n\n##### timeout\n\nType: `number`\u003cbr\u003e\nDefault: `3000`\n\nSelf destroy in specfic timeout. If given `0` or `false then toast will never self destroy.\n\n##### type\n\nType: `string`\u003cbr\u003e\nDefault: `undefined`\n\nOne of `success` `warning` `info` `error`.\n\nA short-hand usage: `nativeToast.success(opts)` `nativeToast.error(opts)` and such.\n\n##### icon\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nSet to `false` to disable icon.\n\n##### edge\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nShow toast on the edge.\n\n##### closeOnClick\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nClose the toast when clicked.\n\n##### elements\n\nType: `HTMLElement[]`\n\nOptionally provide an array of HTML elements to insert after the `message`.\n\n## License\n\nMIT © [EGOIST](https://github.com/egoist)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fnative-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegoist%2Fnative-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fnative-toast/lists"}