🌈 Create new beautiful Compose Gradients with our new wesite ->
Compose Component

SnackbarHost

Host for Snackbars to be used in Scaffold to properly show, hide and dismiss items based on material specification and the hostState.

SnackbarHost

Source set: Common
@Composable
public fun SnackbarHost(
    hostState: SnackbarHostState,
    modifier: Modifier = Modifier,
    snackbar: @Composable (SnackbarData) -> Unit = { Snackbar(it) },
)

Parameters

hostState state of this component to read and show Snackbars accordingly
modifier optional modifier for this component
snackbar the instance of the Snackbar to be shown at the appropriate time with appearance based on the SnackbarData provided as a param