{"id":17831205,"url":"https://github.com/crsten/tasty-toast","last_synced_at":"2025-04-02T12:19:11.106Z","repository":{"id":65478468,"uuid":"71871649","full_name":"crsten/tasty-toast","owner":"crsten","description":"The world's most tastiest notification widget","archived":false,"fork":false,"pushed_at":"2016-11-29T14:21:09.000Z","size":38,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-08T03:23:38.271Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","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/crsten.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-10-25T07:39:19.000Z","updated_at":"2017-07-03T23:08:22.000Z","dependencies_parsed_at":"2023-01-25T07:45:15.174Z","dependency_job_id":null,"html_url":"https://github.com/crsten/tasty-toast","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crsten%2Ftasty-toast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crsten%2Ftasty-toast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crsten%2Ftasty-toast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crsten%2Ftasty-toast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crsten","download_url":"https://codeload.github.com/crsten/tasty-toast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246811312,"owners_count":20837753,"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-10-27T19:42:22.902Z","updated_at":"2025-04-02T12:19:11.088Z","avatar_url":"https://github.com/crsten.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tasty-toast\n[![Build Status](https://travis-ci.org/crsten/tasty-toast.svg?branch=master\u0026style=flat-square)](https://travis-ci.org/crsten/tasty-toast)\n[![npm](https://img.shields.io/npm/dt/tasty-toast.svg?style=flat-square)](https://www.npmjs.com/package/tasty-toast)\n[![Bower](https://img.shields.io/bower/v/tasty-toast.svg?style=flat-square)]()\n[![npm](https://img.shields.io/npm/v/tasty-toast.svg?style=flat-square)](https://www.npmjs.com/package/tasty-toast)\n[![npm](https://img.shields.io/npm/l/tasty-toast.svg?style=flat-square)]()\n\nThe world's tastiest notification widget (Part of the tasty framework)\n\n##Demo\n\nYou can find a small [demo here](http://crsten.github.io/tasty-toast/).\n\n##Installation\n\nYou can get it on npm.\n\n```shell\nnpm install tasty-toast --save\n```\n\nOr bower, too.\n\n```shell\nbower install tasty-toast --save\n```\n\nIf you're not using either package manager, you can use `tasty-toast` by downloading the [files in the `dist` folder](dist).\n\n####Including the JavaScript\n\nPlace `tasty-toast` in the end of `\u003cbody\u003e`.\n\n####Including the CSS\n\nPlace [`dist/tasty-toast.css`](dist/tasty-toast.css) or [`dist/tasty-toast.min.css`](dist/tasty-toast.min.css) in your document.\n\n#Usage\n\ntasty-toast provides the easiest possible API to make notifications breeze in your applications.\n\n##`Tasty.Toast(options)`\n\nYou can provide `options` to customize `tasty-toast`. Here's an **overview of the default values**.\n\n```js\nTasty.Toast({\n  type: '', //['error','success','primary','secondary'] are possible values (or leave it empty for no theme)\n  icon: '', //Insert your image here\n  title: 'Hey there!',\n  content: `You didn't fill out the content.`,\n  duration: 6000,\n  onclick: null\n});\n```\n\nThe options are detailed below.\n\n####`options.type`\n\nThe `options.type` property will give the notification the correct appearance.\nBy default `tasty-toast` has no type. You can set the type of notification by setting the `options.type` property:\n\n```js\nTasty.Toast({\n  type: 'success'\n});\n```\n\n*`options.type` accepts 'success' or 'error'*\n\n####`options.icon`\n\nIf you want to show an icon beside your notification just pass in an URL to an image like this:\n\n```js\nTasty.Toast({\n  icon: 'http://MYAWESOMEPAGE.com/COOLICON.png'\n});\n```\n\n*`options.icon` accepts a string as input and ignores all other types.*\n\n####`options.title`\n\nBy default `tasty-toast` has `\"Hey there\"` as the title text. You can change the title text by sending them in to the options at initialization:\n\n```js\nTasty.Toast({\n  title: 'Hey there, something awsome happened!'\n});\n```\n*`options.title` accepts a string as input and ignores all other types.*\n\n####`options.content`\n\nBy default `tasty-toast` has `\"You didn't fill out the content.\"` as content. You can change the content by sending them in to the options at initialization:\n\n```js\nTasty.Toast({\n  content: 'You have recieved a \u003cb\u003egift\u003c/b\u003e.'\n});\n```\n\n*`options.content` accepts a string as input. You can use HTML here... just sayin*\n\n####`options.duration`\n\nBy default `tasty-toast` has a duration of 6000 miliseconds. You can set your own duration by setting the duration property at initialization:\n\n```js\nTasty.Toast({\n  duration: 10000 // show me 10 seconds please\n});\n```\n\n*`options.duration` accepts a number as input. The number represents the duration in miliseconds*\n\n####`options.onclick`\n\nWith `options.onclick` you can set a custom action when the notification object is clicked!\n\n```js\nTasty.Toast({\n  onclick: function(){\n    console.log('I do stuff...')\n  }\n});\n```\n\n*`options.onclick` accepts a function as input*\n\n---\n\n**Great shoutout to [Kent C. Dodds](https://github.com/kentcdodds) for providing great tutorials on [how to write an open source library](https://egghead.io/series/how-to-write-an-open-source-javascript-library)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrsten%2Ftasty-toast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrsten%2Ftasty-toast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrsten%2Ftasty-toast/lists"}