Allow more custom toast style customization
See original GitHub issueDescription
It would be preferred to have a simple way to override the backgroundColor
in containerStyle
.
If there is a way, I did not find it.
Problem Statement/Justification
The current colors based on status are rather imposing.
Proposed Solution or API
For example:
export const postChangedToast = (): UseToastOptions => ({
title: "This post got updated",
description: "Test description",
duration: 5000,
position: "top",
containerStyle: {
backgroundColor: "red"
}
});
This still renders the default infobox, and just colors the background ‘behind’ the infobox.
Alternatives
I’ve tried the demos on the documentation page. Couldn’t manage to change the background color, although changing some other styles worked.
Additional Information
It seems that standard React styles are used, but I couldn’t manage to change the color of the toast box. Don’t really understand I couldn’t find another issue describing the same (maybe I didn’t look well enough), it’s the first thing I tried before adding it to my site.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Creating Custom Toast in Android | by Usman Khan
You can of course customize the Toast however you want by playing around with gravity , duration , layout etc, the above is...
Read more >How to customize style of Toast window? - css - Stack Overflow
I needed to add an additional reference to the toast container in styles.css. The html remains mostly the same. <p-toast class="custom-toast"></ ...
Read more >How to add a custom styled Toast in Android using Kotlin
Go to res -> layout (right-click) -> new -> Layout Resource file -> Create (custom_toast_layout.xml) file. Add a CardView to contain the custom...
Read more >CUSTOM TOAST VIEWS IN ANDROID. Have you ... - Medium
Have you come across custom Toasts that are different from your default Toast and you are wondering how they were made?
Read more >Android Custom Toast with Examples - Tutlane
Android custom toast with examples. In android we can customize the style of toast notification to change the appearance to show the messages...
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
Hey @kimgysen this is what I’ve done and it works fine,
The
offset
in my case is from the bottom. Hope this helps.You can use the
variant
property inUseToastOptions
to choose the Alert variant Chakra UI Docs | Toast | Variants Kindly see this CodeSandbox for an example.Kindly close this issue if it solves you issue ✨