Skip to content

Toast Component

A toast notification component.

Properties

NameTypeDefaultDescription
show-dismiss-buttonbooleanfalseIndicates whether to show the dismiss button.
variant'success' | 'error' | 'info' | 'warning' | 'inverse''inverse'The variant of the toast notification. Defaults to inverse.

CSS Parts

NameDescription
toastThe main container for the toast notification.
iconThe container for the icon.
messageThe container for the message.
dismissThe container for the dismiss button.

Check this link to learn how to use CSS parts for Toast Component.

CSS Properties

TokenDefaultDescription
--tap-toast-vertical-padding--tap-sys-spacing-5The vertical padding inside the toast.
--tap-toast-horizontal-padding--tap-sys-spacing-5The horizontal padding inside the toast.
--tap-toast-background-color-default--tap-sys-color-surface-inverse-secondaryThe default background color of the toast.
--tap-toast-color-default--tap-sys-color-content-on-inverseThe default text color of the toast.
--tap-toast-background-color-success--tap-sys-color-surface-positiveThe background color of the success variant.
--tap-toast-color-success--tap-sys-color-content-on-inverseThe text color of the success variant.
--tap-toast-background-color-error--tap-sys-color-surface-negativeThe background color of the error variant.
--tap-toast-color-error--tap-sys-color-content-on-inverseThe text color of the error variant.
--tap-toast-background-color-info--tap-sys-color-surface-accentThe background color of the info variant.
--tap-toast-color-info--tap-sys-color-content-on-inverseThe text color of the info variant.
--tap-toast-background-color-warning--tap-sys-color-surface-warningThe background color of the warning variant.
--tap-toast-color-warning--tap-sys-color-content-primaryThe text color of the warning variant.
--tap-toast-background-color-inverse--tap-sys-color-surface-inverse-secondaryThe background color of the inverse variant.
--tap-toast-color-inverse--tap-sys-color-content-on-inverseThe text color of the inverse variant.
--tap-toast-dismiss-color'inherit'The color of the dismiss button.
--tap-toast-dismiss-background-colortransparentThe background color of the dismiss button.

Events

NameDescription
dismissFires when the toast dismiss button is clicked