3

Update

We finally have BottomSheet in Material3 follow this ans Link

Recently I created a project using `material3` with `jetpack compose` but when I tried to import `ModalBottomSheetLayout` but I couldn't find it. Is there any `alternate in material3` or not ?

In previous material version we do like :-

ModalBottomSheetLayout(sheetContent = ) {
        
    }
Jeevan Rupacha
  • 3,055
  • 1
  • 15
  • 29
  • Just add sheetContent and it would be solved – Karan Mehta Jun 01 '22 at 12:16
  • 1
    You can find all the [Jetpack Compose Material 3 components here](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary#ModalNavigationDrawer(kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.material3.DrawerState,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,kotlin.Function0)). `ModalBottomSheetLayout` is not yet ported to Material 3. Lot of components are still Work In Progress. – Abhimanyu Jun 01 '22 at 16:33

3 Answers3

1

Based on this package summary it is not currently available in Material 3 for Compose.

Code Poet
  • 6,222
  • 2
  • 29
  • 50
1

Maybe this will help you or you make do it

implementation 'androidx.compose.ui:ui:1.4.3'
implementation 'androidx.compose.ui:ui-tooling'
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3:1.1.1'

yes i just added the latest stable version

vitaliyJR
  • 11
  • 1
  • Maybe? You guess? You can improve your answer by providing proof (code and a screenshot) that it doesn't work for older versions of those packages and then proof that it works with the latest versions. The code would be something that uses ModalBottomSheetLayout. You don't have to provide all the files because every Android project is quite large but `app/build.gradle` and `MainActivity.kt` should suffice. – sanitizedUser Jul 08 '23 at 07:17
  • In my case it helped, I am using the latest version of android studio and components – vitaliyJR Aug 26 '23 at 05:42
0

As in material3 version 1.1.0-alpha08 bottom sheet are experimental. Original post: https://stackoverflow.com/a/73594618/15739324

guerdaa
  • 157
  • 1
  • 7