question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom variants of toast when using headless mode

See original GitHub issue

Hi! Is it possible to provide any custom variants of toast with the headless mode? It would be great, if we could create Notifications component and have own success, error and other toast’s variants to use it, as:

toast.custom('My custom toast variant')

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

18reactions
timolinscommented, Jan 8, 2021

Thanks for the input. This definitely something that should be possible, but isn’t right now.

Would an API like this work for you?


// ⚠️ Draft, not an actual API
import { createCustomToaster } from 'react-hot-toast'

const { useToaster, Toaster, toast } = createCustomToaster([ "info", "custom" ])

<Toaster
  toastOptions={{
    info: {
     icon: "💡"
    }
  }}
/>

toast.info("Did you know...")

2reactions
MHasecommented, Apr 25, 2022

hey guys 👋🏻 any progress on that feature or maybe simple workaround? I have similar issue for warning variant and it doesn’t seem too intuitive to use e.g. toast('This is warning message'); by default

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to display toast or custom error message with in quick ...
I was able to achieve a Quick Action without a modal and a Toast using a LWC with a "headless action" with Summer...
Read more >
Elements fail to locate in Protractor and Selenium because ...
Update: I have tried the following and many variants on it, nothing is working. My executeAsyncScript executions no longer time out now that...
Read more >
react-hot-toast - The Best React Notifications in Town
Easy to use. Accessible. Emoji Support. Customizable. Promise API. Lightweight. Pause on hover. Headless Hooks. 1. Install package. It weighs less than 5kb....
Read more >
How to change the default WYSIWYG to Toast UI editor - Strapi
An npm package let you the possibility to replace the default WYSIWYG editor in Strapi by Toast UI editor. Customize your headless cms...
Read more >
React-Toastify - GitHub Pages
By default, all toasts will inherit ToastContainer's props. Props defined on toast supersede ToastContainer's props. Props marked with * can only be set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found