Jenga Snackbar Host
fun JengaSnackbarHost(hostState: JengaSnackbarHostState, modifier: Modifier = Modifier, snackbarPadding: PaddingValues = JengaSnackbarDefaults.hostPadding, shape: Shape = JengaSnackbarDefaults.shape, colors: JengaSnackbarColors = JengaSnackbarDefaults.colors(), contentPadding: PaddingValues = JengaSnackbarDefaults.contentPadding, messageStyle: TextStyle = JengaSnackbarDefaults.messageStyle, actionStyle: TextStyle = JengaSnackbarDefaults.actionStyle)(source)
Renders the snackbar queued on hostState as a JengaSnackbar. Place it in a scaffold's snackbarHost slot (see JengaScaffold).
Parameters
host State
the state from rememberJengaSnackbarHostState.
modifier
the Modifier for the host.
snackbar Padding
space around the snackbar inside the host.
shape
the snackbar shape.
colors
the snackbar color set.
content Padding
padding inside the snackbar.
message Style
the message text style.
action Style
the action label text style.
Samples
val hostState = rememberJengaSnackbarHostState()
// Host it in your scaffold, then call showSnackbar from a coroutine. A plain
// confirmation can stay Short; give an action (e.g. Undo) a Long window so it
// still auto-dismisses instead of sitting there indefinitely:
// hostState.showSnackbar("Removed", actionLabel = "Undo",
// duration = JengaSnackbarDuration.Long)
JengaSnackbarHost(
hostState = hostState,
)Content copied to clipboard