containerStyle prop in Toaster
See original GitHub issueI 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?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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?
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.