Toast
The toast is a feedback component notify the user after an action.
Import
Importimport { Toast } from '@backyard-ui/core';Usage
UsageToaster
ToasterThis component will render all toasts.
<Toaster position="top-center" gutter={8} />Appearances
AppearancesUse the appearance prop to change the visual semantic.
Variants
VariantsBy default variant prop is neutral but you can use solid or subtle to get a different style.
Close Button
Close ButtonUse the isClosable prop to show the close button.
Custom icon
Custom iconTo use a custom icon, pass the icon you choose to AlertIcon.
Custom JSX
Custom JSXYou can use toast.custom to create a custom toast.
Promise
PromiseUse toast.promise to mapping a promise to a toast. It will update automatically when the promise resolves or fails.
API Reference
API ReferenceToast
Toast- titleDescription The Toast titleType
string - description requiredDescription The Toast titleType
string - isClosableDescription If `true`, shows a close buttonType
boolean - roleDescription The role of the alertType
"alert" | "status"Defaultalert - appearanceDescription The alert appearance.Type
"success" | "critical" | "info" | "warning"Defaultsuccess - variantDescription The variant is used to change the visual communication.Type
"neutral" | "solid" | "subtle"Defaultsolid - isLoadingDescription Show loading indicatorType
boolean