KwikToast

fun KwikToast(state: MutableState<KwikToastState>, modifier: Modifier = Modifier)

A modern toast component that can be used to display messages to the user.

Parameters

state

: KwikToastState The state of the toast.

modifier

: The modifier for the toast.

Example usage:

val toastState = rememberKwikToastState()

KwikToast(state = toastState)

// Show a toast
toastState.showToast("This is a toast message")
// show success toast
toastState.showToast("This is a success toast", KwikToastType.SUCCESS)
// show warning toast
toastState.showToast("This is a warning toast", KwikToastType.WARNING)
// show with duration
toastState.showToast("This is a 6 seconds toast", 6000L) // 6 seconds