ToastHost

fun ToastHost(hostState: ToastHostState, modifier: Modifier = Modifier, position: ToastPosition = ToastPosition.BOTTOM, dismissLabel: String = "Dismiss", toast: @Composable (ToastData) -> Unit = { data -> DefaultToast(data, dismissLabel) })

Shows the toast held by hostState over the screen, sliding it in from position, dismissing it after its ToastDuration adjusted for the user's accessibility timeout, and keeping it inside the safe drawing area. Place it as the last child of the screen so it floats above the content.

An ToastDuration.INDEFINITE toast without an action is tap-to-dismiss, so it can always be cleared; dismissLabel names that action for screen readers.