Search code examples
androidkotlinandroid-jetpack-composeandroid-jetpackwordpress-jetpack

Designing a slider menu in jetpack compose


Is there an inbuilt funtionality in jetpack compose to design a slider menu like this one that comes up from bottom (I am talking about the menu titled ADD MONEY TO EA DUMPLING)?

enter image description here

Would appreciate some help. Thanks!


Solution

  • You can use Bottom sheets. A basic example of how to implement it.

    var showBottomSheet by remember { mutableStateOf(false) }
    val sheetState = rememberModalBottomSheetState()
    
    if (showBottomSheet) {
        ModalBottomSheet(
            onDismissRequest = { showBottomSheet = false },
            sheetState = sheetState,
        ) {
            // Your bottom sheet content
        }
    }