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.

containerStyle prop in Toaster

See original GitHub issue

I need to customize some of the styling for the toast container. I don’t see anything in the documentation, but I found containerStyle in the Toaster component below, however, it doesn’t seem to do anything when passing it into the Toaster component.

Is there a reason this is here?

https://github.com/timolins/react-hot-toast/blob/7e4391db1908ff0168bacd87beda115408b76ce0/src/components/toaster.tsx#L32

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lsbyerleycommented, Apr 22, 2021

So, it turns out, I actually need to be able to add a style to the “inside container” of the toaster, as opposed to the “outer container” which is what containerStyle references.

The “inside container” is in the toast-bar component: https://github.com/timolins/react-hot-toast/blob/351e62ab6248a41cd7267e74e710c27ca081aacc/src/components/toast-bar.tsx#L130

Would you accept a PR adding this style config?

0reactions
timolinscommented, May 31, 2021

2.0 is out now. You can read about the changes here: https://react-hot-toast.com/docs/version-2

It changes the behaviour how the Toaster is positioned, which might resolve the issues you had. I’ll close this issue for now, feel free to reopen if the problem remains.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<Toaster/> API - React Hot Toast
Defaults to undefined . containerStyle Prop. Customize the style of toaster div. This can be used to change the offset of all toasts....
Read more >
Toast containerStyle in TypeScript · Issue #6775 · chakra-ui ...
The type of containerStyle is defined as React.CSSProperties , which is throwing a TypeError when passing props like in other chakra ...
Read more >
How to style | React-Toastify - GitHub Pages
The ToastContainer accept the following props for styling: className: applied to the container; toastClassName: applied on the toast wrapper ...
Read more >
Toast - Chakra UI
The toast component is used to give feedback to users after an action has taken ... The toast function now exposes a containerStyle...
Read more >
How can I change the styles of the react-toastify popup ...
In my app's CSS file I overwrite the background-property in the default classes. I also define my own classes for toast body and...
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