Snackbar

fun Snackbar(modifier: Modifier = Modifier, intent: SnackbarIntent = SnackbarDefaults.intent, icon: SparkIcon? = null, title: String? = null, actionLabel: String? = null, onActionClick: () -> Unit? = null, onDismissClick: () -> Unit? = null, content: @Composable () -> Unit)(source)

Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn’t interrupt the user experience, and they don’t require user input to disappear.

A Snackbar can contain a single action. Because Snackbar disappears automatically, the action shouldn't be "Dismiss" or "Cancel".

If you want to customise appearance of the Snackbar, you can pass your own version as a child of the SnackbarHost to the Scaffold

Parameters

modifier

modifiers for the Snackbar layout

intent

The SnackbarIntent which defines the colour and icon of the Snackbar. Defaults to SnackbarIntent.Info.

icon

An optional custom icon that overrides the default intent icon.

title

An optional title to be displayed above the message content.

actionLabel

action to add as an action to the snackbar.

onActionClick

callback when the action is clicked.

onDismissClick

Callback for dismiss icon click.


fun Snackbar(data: SnackbarData, modifier: Modifier = Modifier)(source)

Snackbars provide brief messages about app processes at the bottom of the screen.

Snackbars inform users of a process that an app has performed or will perform. They appear temporarily, towards the bottom of the screen. They shouldn’t interrupt the user experience, and they don’t require user input to disappear.

A Snackbar can contain a single action. Because Snackbar disappears automatically, the action shouldn't be "Dismiss" or "Cancel".

If you want to customise appearance of the Snackbar, you can pass your own version as a child of the SnackbarHost to the Scaffold

Parameters

modifier

modifiers for the Snackbar layout

data

data class that contains the necessary information of a particular Snackbar have a look at SnackbarSparkVisuals , SnackbarData