# Bottom sheets [Bottom sheets](https://m3.material.io/components/bottom-sheets/overview) show secondary content anchored to the bottom of the screen. There are two variants of bottom sheets. ![Bottom sheets types](assets/bottomsheet/bottomsheets-types.png) 1. Standard bottom sheet 2. Modal bottom sheet **Note:** Images use various dynamic color schemes. ## Design & API documentation * [Material 3 (M3) spec](https://m3.material.io/components/bottom-sheets/overview) * [API reference](https://developer.android.com/reference/com/google/android/material/bottomsheet/package-summary) ## Anatomy Modal bottom sheets are above a scrim while standard bottom sheets don't have a scrim. Besides this, both types of bottom sheets have the same specs. ![Bottom sheet anatomy](assets/bottomsheet/bottomsheet-anatomy.png) 1. Container 2. Drag handle (optional) 3. Scrim More details on anatomy items in the [component guidelines](https://m3.material.io/components/bottom-sheets/guidelines#0dd76c6d-7f76-4ff4-b325-0abf28b00029). ## Key properties ### Sheet attributes Element | Attribute | Related method(s) | Default value -------------- | --------------------- | --------------------------------- | ------------- **Color** | `app:backgroundTint` | N/A | `?attr/colorSurfaceContainerLow` **Shape** | `app:shapeAppearance` | N/A | `?attr/shapeAppearanceCornerExtraLarge` **Elevation** | `android:elevation` | N/A | `1dp` **Max width** | `android:maxWidth` | `setMaxWidth`
`getMaxWidth` | `640dp` **Max height** | `android:maxHeight` | `setMaxHeight`
`getMaxHeight` | N/A ### Behavior attributes More information about these attributes and how to use them in the [setting behavior](#setting-behavior) section. Behavior | Related method(s) | Default value ------------------------------------------------- | ------------------------------------------------------------------------- | ------------- `app:behavior_peekHeight` | `setPeekHeight`
`getPeekHeight` | `auto` `app:behavior_hideable` | `setHideable`
`isHideable` | `false` for standard
`true` for modal `app:behavior_skipCollapsed` | `setSkipCollapsed`
`getSkipCollapsed` | `false` `app:behavior_fitToContents` | `setFitToContents`
`isFitToContents` | `true` `app:behavior_draggable` | `setDraggable`
`isDraggable` | `true` `app:behavior_draggableOnNestedScroll` | `setDraggableOnNestedScroll`
`isDraggableOnNestedScroll` | `true` `app:behavior_halfExpandedRatio` | `setHalfExpandedRatio`
`getHalfExpandedRatio` | `0.5` `app:behavior_expandedOffset` | `setExpandedOffset`
`getExpandedOffset` | `0dp` `app:behavior_significantVelocityThreshold` | `setSignificantVelocityThreshold`
`getSignificantVelocityThreshold` | `500 pixels/s` `app:behavior_multipleScrollingChildrenSupported` | N/A | `false` To save behavior on configuration change: Attribute | Related method(s) | Default value ------------------------ | --------------------------------- | ------------- `app:behavior_saveFlags` | `setSaveFlags`
`getSaveFlags` | `SAVE_NONE` ### Styles Element | Default value | Theme attribute ------------------------- | ------------------------------------------- | --------------- **Default style (modal)** | `@style/Widget.Material3.BottomSheet.Modal` | `?attr/bottomSheetStyle` **Note**: The `?attr/bottomSheetStyle` default style theme attribute is for modal bottom sheets only. There is no default style theme attribute for standard bottom sheets, because `BottomSheetBehavior`s don't have a designated associated `View`. ### Theme overlays Element | Theme overlay | Attribute ------------------------- | ------------------------------------------ | --------- **Default theme overlay** | `ThemeOverlay.Material3.BottomSheetDialog` | `?attr/bottomSheetDialogTheme` For the full list, see [styles](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/bottomsheet/res/values/styles.xml), [attrs](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/bottomsheet/res/values/attrs.xml), and [themes and theme overlays](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/bottomsheet/res/values/themes.xml). ## Variants of bottom sheets ### Standard bottom sheet Standard bottom sheets co-exist with the screen’s main UI region and allow for simultaneously viewing and interacting with both regions. They are commonly used to keep a feature or secondary content visible on screen when content in the main UI region is frequently scrolled or panned. [`BottomSheetBehavior`](https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior) is applied to a child of [CoordinatorLayout](https://developer.android.com/reference/androidx/coordinatorlayout/widget/CoordinatorLayout) to make that child a **persistent bottom sheet**, which is a view that comes up from the bottom of the screen, elevated over the main content. It can be dragged vertically to expose more or less content. API and source code: * `BottomSheetBehavior` * [Class definition](https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior) * [Class source](https://github.com/material-components/material-components-android/tree/master/lib/java/com/google/android/material/bottomsheet/BottomSheetBehavior.java) #### Standard bottom sheet example The following example shows a standard bottom sheet in its collapsed and expanded states: Collapsed
| Expanded
--------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- Standard collapsed bottom sheet example. | Standard expanded bottom sheet example. `BottomSheetBehavior` works in tandem with `CoordinatorLayout` to let you display content on a bottom sheet, perform enter/exit animations, respond to dragging/swiping gestures, etc. Apply the `BottomSheetBehavior` to a direct child `View` of `CoordinatorLayout`: ```xml