← Back to Compose Multiplatform
SnackbarHost
Component
in
Compose Multiplatform
. Since 1.3.0-beta01Overview
Examples
Community Notes
Host for Snackbars to be used in Scaffold to properly show, hide and dismiss items based on Material specification and the hostState.
This component with default parameters comes build-in with Scaffold, if you need to show a default Snackbar, use SnackbarHostState.showSnackbar.
Overloads
SnackbarHost
@Composable
fun SnackbarHost(
hostState: SnackbarHostState,
modifier: Modifier = Modifier,
snackbar: @Composable (SnackbarData) -> Unit = { Snackbar(it) }
)
Parameters
Name | Description |
---|---|
hostState | state of this component to read and show Snackbars accordingly |
modifier | the Modifier to be applied to this component |
snackbar | the instance of the Snackbar to be shown at the appropriate time with appearance based on the SnackbarData provided as a para |
SnackbarHost
@Composable
fun SnackbarHost(
hostState: SnackbarHostState,
modifier: Modifier = Modifier,
snackbar: @Composable (SnackbarData) -> Unit = { Snackbar(it) }
)
Parameters
Name | Description |
---|---|
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 para |

Previous Component← Snackbar
Next ComponentSuggestionChip →
