Skip to content

A bottom sheet dialog for Jetpack Compose, similar to AlertDialog

Notifications You must be signed in to change notification settings

X1nto/BottomSheetDialogCompose

Repository files navigation

BottomSheetDialogCompose

A bottom sheet dialog for Jetpack Compose that provides the same syntax as AlertDialog.

Installation

Groovy

Add JitPack repository to root build.gradle

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add OverlappingPanelsCompose dependency to app build.gradle

dependencies {
    implementation 'com.github.X1nto:BottomSheetDialogCompose:1.0.1'
}

Kotlin DSL

Add JitPack repository to root build.gradle

allprojects {
    repositories {
        ...
        maven(url = "https://jitpack.io")
    }
}

Add OverlappingPanelsCompose dependency to app build.gradle

dependencies {
    implementation("com.github.X1nto:BottomSheetDialogCompose:1.0.1")
}

Basic usage

var showDialog by remember { mutableStateOf(false) }
Button(onClick = {
    showDialog = true
}) {
    Text("Show Dialog")
}
if (showDialog) {
    BottomSheetDialog(onDismissRequest = {
        showDialog = false
    }) {
        //Your content
    }
}

Check out the sample app for a better example on how to use the library.