-
Notifications
You must be signed in to change notification settings - Fork 2
toast README
github-actions[bot] edited this page Jun 2, 2026
·
1 revision
Compose Multiplatform toast notification system.
A lightweight, composable toast library for Compose Multiplatform. Show short non-blocking messages with optional action buttons — positioned at top, center, or bottom of screen, with 5 visual styles and 3 duration presets.
No platform channels, no native code, no DI, no Supabase. Pure Compose.
// 1. Create state (in composable)
val toastState = rememberToastHostState()
val scope = rememberCoroutineScope()
// 2. Place ToastHost in your root Box / Scaffold
Box(modifier = Modifier.fillMaxSize()) {
YourScreenContent()
ToastHost(hostState = toastState)
}
// 3. Show toasts from anywhere that has the scope
scope.launch {
toastState.showToast("File saved!")
// with options:
toastState.showToast(
message = "Copied to clipboard",
actionLabel = "Undo",
duration = ToastDuration.LONG,
position = ToastPosition.BOTTOM,
style = ToastStyle.SUCCESS,
)
}// Create (in composable)
val toastState = rememberToastHostState()
// Show (in coroutine scope)
suspend fun showToast(
message: String,
actionLabel: String? = null,
duration: ToastDuration = ToastDuration.SHORT,
position: ToastPosition = ToastPosition.BOTTOM,
style: ToastStyle = ToastStyle.DEFAULT,
): ToastResult
// Dismiss programmatically
fun dismiss()
// Observe
val currentToast: StateFlow<ToastData?>@Composable
fun ToastHost(
hostState: ToastHostState,
modifier: Modifier = Modifier,
toast: @Composable (ToastData) -> Unit = { DefaultToast(it) },
)enum class ToastDuration { SHORT, LONG, INDEFINITE }
// SHORT = 3000ms, LONG = 5000ms, INDEFINITE = stays until dismissed
enum class ToastPosition { TOP, CENTER, BOTTOM }
enum class ToastStyle { DEFAULT, SUCCESS, ERROR, WARNING, INFO }enum class ToastResult { DISMISSED, ACTION_PERFORMED }Runs everywhere Compose Multiplatform runs:
| Platform | Support |
|---|---|
| Android | ✅ |
| iOS | ✅ |
| macOS | ✅ |
| JVM | ✅ |
| JS / Wasm | ✅ |
- SETUP.md — Integration steps
-
CLAUDE_AI_SETUP.md — AI-assisted setup with
/sync-toast
** Partials**
App Intents
Bubble
Clipboard
Cookbook
- Clipboard Copy Text
- Clipboard Read Text
- Consumer Anon Key Setup
- Crashlytics Attribution Per Library
- Ifonline Block
- Index
- Index
- Index
- Index
- Open Url Compose
- Pick And Share Image
- React To Offline
- Register Firebase Hooks
- Share Pdf Android
- Share Text
- Wifi Vs Cellular
Firebase Analytics
In App Update
Intent Launcher
Inter App Comms
Modules
- Cmp App Intents
- Cmp App Intents Compose
- Cmp Bubble
- Cmp Clipboard
- Cmp Deep Link
- Cmp Firebase Analytics
- Cmp In App Update
- Cmp Intent Launcher
- Cmp Intent Launcher Compose
- Cmp Library
- Cmp Network Monitor
- Cmp Network Monitor Compose
- Cmp Observe
- Cmp Observe Koin
- Cmp Open Url
- Cmp Pdf Generator
- Cmp Product Tickets
- Cmp Remote Config
- Cmp Share
- Cmp Share Compose
- Cmp Toast
Network Monitor
Open Url
Pdf Generator
Remote Config
Share
Toast
User Tickets
General