Snackbar API

API reference docs for theSnackbarcomponent. For examples and details on the usage of this component, visit the component demo page.

Props

PropsTypeDescriptionDefault
titlestringDisplays the label/title_
description?stringDisplays the description_
variant?'info' | 'positive' | 'critical' | 'loading'Represents the variants of the component_
actionButton?objectTo prompt users to take specific actions_
actionButton.textstringRepresents the text for the action button_
actionButton.onClickfunctionCallback invoked when the action button is clicked_
onCloseButtonClick?functionCallback invoked when the close button is clicked_
openbooleanControls the visibility of the Snackbar_
onClosefunctionCallback invoked when the Snackbar is auto-dismissed._
placement'top-start' | 'top-end' | 'bottom-start' | 'bottom-end'To anchor the position of the Snackbar_
offset?[number,number]To adjust the vertical & horizontal position of the Snackbar. Value is computed in pixels[8,8]
autoCloseDuration?numberTo auto-dismiss the Snackbar after a certain time. Specify the time in milliseconds3000