{"repo":"wobsoriano/svelte-sonner","free":true,"listed":false,"github":"https://github.com/wobsoriano/svelte-sonner","clone":"git clone https://github.com/wobsoriano/svelte-sonner.git","description":"An opinionated toast component for Svelte. A port of @emilkowalski's sonner.","language":"Svelte","stars":1284,"topics":["svelte","toast","notifications"],"license":"MIT","category":"ui-components","readme_excerpt":"https://github.com/wobsoriano/svelte-sonner/assets/13049130/4b9c250f-1431-4130-9c5b-5a4f8b0210c5 svelte-sonner An opinionated toast component for Svelte. A port of Emil Kowalski's Sonner. Quick start Install it: Add to your app, it will be the place where all your toasts will be rendered. After that, you can use toast() from anywhere in your app. Types Default Most basic toast. You can customize it (and any other type) by passing an options object as the second argument. With custom icon and description: Success Renders a checkmark icon in front of the message. Info Renders a question mark icon in front of the message. Warning Renders a warning icon in front of the message. Error Renders an error icon in front of the message. Action Renders a button. Promise Starts in a loading state and will update automatically after the promise resolves or fails. You can pass a function to the success/error messages to incorporate the result/error of the promise. Custom Component You can pass a component as the first argument instead of a string to render custom component while maintaining default styling. You can use the headless version below for a custom, unstyled toast. Updating a toast You can update a toast by using the toast function and passing it the id of the toast you want to update, the rest stays the same. Customization Headless You can use toast.custom to render an unstyled toast with custom component while maintaining the functionality. Theme You can change the theme using t","default_branch":null,"files":null,"tree":[],"storefront":"/r/wobsoriano","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/wobsoriano/svelte-sonner/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}