StylishToastHostState

State holder for a stack of toasts displayed by StylishToastHost.

Create with rememberStylishToastHostState and show toasts from any coroutine scope:

val hostState = rememberStylishToastHostState()
val scope = rememberCoroutineScope()
scope.launch { hostState.showToast(StylishToastData("保存しました", StylishToastVariant.Success)) }

Toasts are displayed bottom-stacked and dismissed automatically after their StylishToastData.durationMillis.

Functions

Link copied to clipboard

Removes toast from the stack immediately.

Link copied to clipboard
suspend fun showToast(toast: StylishToastData)

Shows toast and dismisses it automatically after its duration.