JengaSnackbarHost

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

hostState
modifier

the Modifier for the host.

snackbarPadding

space around the snackbar inside the host.

shape

the snackbar shape.

colors

the snackbar color set.

contentPadding

padding inside the snackbar.

messageStyle

the message text style.

actionStyle

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,
)