Snackbar API

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

Props

Props

Type

Description

Default

title

string

Displays the label/title

_

description?

string

Displays the description

_

variant?

'info' | 'positive' | 'critical' | 'loading'

Represents the variants of the component

_

actionButton?

object

To prompt users to take specific actions

_

actionButton.text

string

Represents the text for the action button

_

actionButton.onClick

function

Callback invoked when the action button is clicked

_

onCloseButtonClick?

function

Callback invoked when the close button is clicked

_

open

boolean

Controls the visibility of the Snackbar

_

onClose

function

Callback 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?

number

To auto-dismiss the Snackbar after a certain time. Specify the time in milliseconds

3000