Repository navigation
Toast should be able to have status's, or assign a class name to it using the addToast method #1308
Closed
Micah Jones (micahjones13)
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Use Case
I need to generate error/success toasts based on API calls. If the api fails, make an error toast. If it passes, make a success one.
According to the figma documentation (toast page), toasts can use the notification banner status colors.
Proposed Feature
I propose that a rux-toast gain a new prop for status, similar to rux-notification. This status would then set the border color and the close ("X") icon color. This way, each time you create a toast using toast-stacks addToast method, you can pass it a status prop as well as a message prop.
Alternatively, you could have a class prop added instead (or in addition to). This would allow for styling to be more dynamic because each toast could have it's own class. I think both may be the way to go here.
All reactions