Alert library facilitates creating customizable alerts with styles like Standard, Split, and Snackbar, supporting features like automatic dismissal, vibration, and background color customization.
Alert library for Compose Multiplatform(Android, IOS, Desktop)
Add this line to shared build.gradle
sourceSets {
commonMain.dependencies {
implementation("io.github.akardas16:alertercompose:1.0.5")
}
}| Standard | Split | Snackbar |
|---|---|---|
var showAlert by remember { mutableStateOf(false) }
Alerter(isVisible = showAlert, alertStyle = AlertStyle.Standard,
onChanged = { showAlert = it },
backgroundColor = Color.White
) {
//Your Custom View
}@Composable
fun Alerter(isVisible: Boolean, // Show/Hide alerter
onChanged:(visibility:Boolean) -> Unit,
backgroundColor: Color, //Define your background color
alertStyle: AlertStyle = AlertStyle.Standard, //Change alerter style (Standard, Split, Snackbar)
enableDismissWhenAlertClick:Boolean = true, // Dismiss alert when click on alert
enableDismissAutomatically:Boolean = true, // Dismiss alert automotically with spesified duration
duration:Long = 5000, // Alert duration if enableDismissAutomatically is true
enableVibration:Boolean = true, // enable/disable vibration when alert visible
content: @Composable () -> Unit) {Alert library for Compose Multiplatform(Android, IOS, Desktop)
Add this line to shared build.gradle
sourceSets {
commonMain.dependencies {
implementation("io.github.akardas16:alertercompose:1.0.5")
}
}| Standard | Split | Snackbar |
|---|---|---|
var showAlert by remember { mutableStateOf(false) }
Alerter(isVisible = showAlert, alertStyle = AlertStyle.Standard,
onChanged = { showAlert = it },
backgroundColor = Color.White
) {
//Your Custom View
}@Composable
fun Alerter(isVisible: Boolean, // Show/Hide alerter
onChanged:(visibility:Boolean) -> Unit,
backgroundColor: Color, //Define your background color
alertStyle: AlertStyle = AlertStyle.Standard, //Change alerter style (Standard, Split, Snackbar)
enableDismissWhenAlertClick:Boolean = true, // Dismiss alert when click on alert
enableDismissAutomatically:Boolean = true, // Dismiss alert automotically with spesified duration
duration:Long = 5000, // Alert duration if enableDismissAutomatically is true
enableVibration:Boolean = true, // enable/disable vibration when alert visible
content: @Composable () -> Unit) {