Can't find ModalBottomSheet in jetpack compose

452 Views Asked by At

I am trying to implement a simple ModalBottomSheet in material 3 Jetpack compose however I cannot find it

I tried to first simply create the composable, and when that gave an error I also tried to force it import the composable

import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.ui.Modifier
import androidx.compose.material3.ModalBottomSheet //This is not a recognized import

@Composable
fun SelectedContactSheet(
    visible: MutableState<Boolean>,
    modifier: Modifier = Modifier
) {
    ModalBottomSheet(){} // This is not a recognized composable
}
1

There are 1 best solutions below

1
On BEST ANSWER

ModalBottomSheet is available at androidx.compose.material3

Please check if you have implemented the correct library.

dependencies {
    implementation("androidx.compose.material3:material3:1.1.1")
}