
Enhances toast notifications with seamless integration across mobile, web, and desktop platforms using Compose Multiplatform, offering versatile and customizable message displays.
KToast is a lightweight toast/notice library built with Kotlin Multiplatform and Compose Multiplatform. It provides a simple, unified API to show toasts across Android, iOS, Desktop (JVM), and Web/Wasm with sensible defaults and smooth transitions.
| Android | Desktop | Web | iOS |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
ToastState you can pass aroundToastDefaults
Add KToast to your multiplatform project from commonMain.
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("com.tarifchakder:ktoast:<latest>")
}
}
}
}[versions]
toast = "1.0.5" # TODO: replace with the latest from Maven Central
[libraries]
k-toast = { module = "com.tarifchakder:ktoast", version.ref = "toast" }// Create toast state
val toast = ToastState()
MaterialTheme {
Box {
ToastHost(
modifier = Modifier.fillMaxSize().padding(20.dp),
alignment = Alignment.BottomCenter,
hostState = toast,
transitionSpec = { ToastDefaults.SLIDE }
)
}
}
// Call it anywhere
toast.showToast("Hi this is a common toast")This repo includes a sample app to try the library on all targets.
Notes:
Issues and PRs are welcome! To propose a change:
This project is distributed under the MIT License. See LICENSE for details.
KToast is a lightweight toast/notice library built with Kotlin Multiplatform and Compose Multiplatform. It provides a simple, unified API to show toasts across Android, iOS, Desktop (JVM), and Web/Wasm with sensible defaults and smooth transitions.
| Android | Desktop | Web | iOS |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
ToastState you can pass aroundToastDefaults
Add KToast to your multiplatform project from commonMain.
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("com.tarifchakder:ktoast:<latest>")
}
}
}
}[versions]
toast = "1.0.5" # TODO: replace with the latest from Maven Central
[libraries]
k-toast = { module = "com.tarifchakder:ktoast", version.ref = "toast" }// Create toast state
val toast = ToastState()
MaterialTheme {
Box {
ToastHost(
modifier = Modifier.fillMaxSize().padding(20.dp),
alignment = Alignment.BottomCenter,
hostState = toast,
transitionSpec = { ToastDefaults.SLIDE }
)
}
}
// Call it anywhere
toast.showToast("Hi this is a common toast")This repo includes a sample app to try the library on all targets.
Notes:
Issues and PRs are welcome! To propose a change:
This project is distributed under the MIT License. See LICENSE for details.