Skip to main content

BottomSheet

Bottom sheets show supplementary content anchored to the bottom edge. You drag them between snap points, or dismiss them with a downward fling. The component follows the Material Design 3 Bottom sheet specification.

BottomSheet renders through Portal, so you must wrap your app in a PortalHost once at the root. It claims the PORTAL_LAYERS.sheet layer: the lowest overlay layer, below dialogs, snackbars, menus, and tooltips. A percentage snap point resolves against the height of that host below the status bar, so a root-level host gives the sheet the whole window under it. The sheet never extends under the status bar or the Dynamic Island; the scrim still covers them.

Usage​

import { BottomSheet, Button, PortalHost, Typography } from '@rootnative/components'
import { mdiResolver } from '@rootnative/components/mdi'
import { ThemeProvider } from '@rootnative/core'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { useState } from 'react'
import { View } from 'react-native'

function Screen() {
const [open, setOpen] = useState(false)
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Button onPress={() => setOpen(true)}>Share</Button>
<BottomSheet visible={open} onDismiss={() => setOpen(false)}>
<View style={{ padding: 24, paddingTop: 0, gap: 12 }}>
<Typography variant="titleMedium">Share file</Typography>
<Typography variant="bodyMedium">
Drag the handle down, tap the scrim, or press the Android back
button to dismiss.
</Typography>
<Button variant="text" onPress={() => setOpen(false)}>Cancel</Button>
</View>
</BottomSheet>
</View>
)
}

export default function App() {
return (
<SafeAreaProvider>
<ThemeProvider iconResolver={mdiResolver}>
<PortalHost>
<Screen />
</PortalHost>
</ThemeProvider>
</SafeAreaProvider>
)
}

Without snapPoints, the sheet sizes itself to its content (capped at the height of the host below the status bar) and has one rest position. The content renders below the built-in drag handle. The container color extends under the bottom safe-area inset, and the content is padded above it (disable this with insetBottom={false}).

Snap points​

snapPoints are the rest heights of the sheet: numbers in dp, or percentage strings of the height of the portal host below the status bar. The sheet takes the size of the tallest one and translates between them. An index (for snapIndex, defaultSnapIndex, and onSnapIndexChange) refers to the points sorted by resolved height, from low to high, so 0 is always the lowest.

import { BottomSheet, Button, PortalHost, Typography } from '@rootnative/components'
import { mdiResolver } from '@rootnative/components/mdi'
import { ThemeProvider } from '@rootnative/core'
import { SafeAreaProvider } from 'react-native-safe-area-context'
import { useState } from 'react'
import { ScrollView, View } from 'react-native'

function Screen() {
const [open, setOpen] = useState(false)
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Button onPress={() => setOpen(true)}>Nearby places</Button>
<BottomSheet
visible={open}
onDismiss={() => setOpen(false)}
snapPoints={['50%', '90%']}
>
<ScrollView>
<View style={{ padding: 24, paddingTop: 0, gap: 12 }}>
<Typography variant="titleMedium">Nearby places</Typography>
{Array.from({ length: 20 }, (_, i) => (
<Typography key={i} variant="bodyMedium">Place {i + 1}</Typography>
))}
</View>
</ScrollView>
</BottomSheet>
</View>
)
}

export default function App() {
return (
<SafeAreaProvider>
<ThemeProvider iconResolver={mdiResolver}>
<PortalHost>
<Screen />
</PortalHost>
</ThemeProvider>
</SafeAreaProvider>
)
}

A release settles with the MD3 thresholds. A fling faster than 125dp/s commits to the next snap in the direction of the fling. A slow drag that moved at least 56dp settles at the nearest snap. Anything less springs back. Below the lowest snap point, the settle dismisses the sheet.

Change snapIndex to move the sheet from code. The user can still drag to other snaps, and onSnapIndexChange reports them.

Standard variant​

variant="standard" drops the scrim and the modal semantics. The screen behind the sheet stays visible and interactive, as the MD3 standard bottom sheet says. The Android back button stays with navigation. To dismiss the sheet, drag the handle below the lowest snap, or do it from code.

Dragging and scrolling content​

The drag gesture lives on the 48dp touch strip of the handle, not on the sheet body. So a ScrollView inside the sheet scrolls freely, with no conflict with the drag. Give scrollable content its own ScrollView, as in the example above. The surface bounds it, and it scrolls inside the sheet. So when you hide the handle with showDragHandle={false}, you also remove the drag. Dismissal then falls back to the scrim and the back button.

A drag above the tallest snap point rubber-bands. So does a drag below the lowest one when dismissable={false}.

Dismissal​

onDismiss fires for each way out that the user starts: a settle below the lowest snap point, a scrim tap, the Android hardware back button, and the dismiss accessibility action of the drag handle. Set visible to false in response. The sheet runs its exit slide and unmounts.

Set dismissable={false} when the user has to resolve the sheet with one of its actions. The scrim then stops responding (and the screen reader stops announcing it), the back button falls through to navigation, and a downward drag rubber-bands back to the lowest snap.

Motion​

The sheet slides in from the bottom edge on springDefaultSpatial. After a drag it settles on the same spring, seeded with the release velocity. The scrim fades on springFastEffects. Under reduced motion, each of these goes to its end value at once; see Motion. The position during a drag follows the finger 1:1, and reduced motion doesn't change that.

Tokens​

TokenValue
ContainersurfaceContainerLow
CornerTop 28dp (cornerExtraLarge)
ElevationLevel 1 (modal and standard)
WidthFills the window, max 640dp, centered
Drag handle32×4dp, onSurfaceVariant, in a 48dp touch strip
Scrim (modal)scrim @ 32%
Settle thresholds56dp positional, 125dp/s velocity

Intentional deviation. Older MD3 spec pages draw the drag handle at 40% opacity. The current Jetpack Compose Material 3 library (updated for Expressive) uses onSurfaceVariant at full opacity, and by the audit convention of the library the Expressive value wins.

Accessibility​

  • The modal surface reports role="dialog", aria-modal, and accessibilityViewIsModal, so assistive technology treats the content below as inert. The standard variant reports none of these.
  • The screen reader announces the scrim as a button labelled "Close sheet". Override the label with scrimAccessibilityLabel. The scrim leaves the accessibility tree when dismissable={false}.
  • The drag handle announces as adjustable ("Drag handle", override with dragHandleAccessibilityLabel), with its snap position as the value. The increment and decrement actions expand and collapse between snap points, and an escape action dismisses.
  • On the web the handle is focusable: the arrow keys move between snap points, and Escape dismisses.
  • On the web, the modal variant also keeps keyboard focus inside. Focus moves into the sheet when it opens, Tab cycles inside it, Escape dismisses a dismissable sheet from anywhere in it, and focus returns to the opening control on close. The standard variant does none of this, on purpose, because it keeps the content behind it usable. See Accessibility.

Props​

PropTypeDefaultRequiredDescription
visibleboolean-YesWhether the sheet is shown. Exit animations run before it unmounts.
onDismiss() => void-YesCalled when the user dismisses the sheet — a drag below the lowest snap point, a scrim tap, or the Android back button. Set `visible` to `false` in response, or the sheet stays mounted off screen.
childrenReactNode-NoSheet content. Renders below the drag handle; scrolling is yours.
variantenummodalNoSheet behavior.
snapPointsBottomSheetSnapPoint[]-NoResting heights the sheet snaps to, e.g. `[240, '90%']`. A percentage is of the portal host's height below the status bar. The sheet is sized to the tallest one; indices used by `snapIndex` / `defaultSnapIndex` / `onSnapIndexChange` refer to the points sorted ascending by resolved height. Omit to size the sheet to its content with a single snap.
snapIndexnumber-NoSnap index to settle at. Changing it animates the sheet there; the user can still drag to other snaps, reported through `onSnapIndexChange`.
defaultSnapIndexnumber0NoSnap index the sheet opens at.
onSnapIndexChange(index: number) => void-NoCalled when the sheet settles at a different snap point.
dismissablebooleanNoWhether the scrim tap, the Android back button, and a downward drag past the lowest snap point dismiss the sheet. When `false`, drags below the lowest snap rubber-band back.
showDragHandlebooleanNoWhether the drag handle is shown. Without it the sheet cannot be dragged — dismissal is limited to the scrim and the back button.
insetBottombooleanNoWhether the sheet's content is padded by the bottom safe-area inset. The container color still extends under the inset.
containerColorstringsurfaceContainerLowNoOverride the container (surface) color.
hostNamestring-NoRender into a specific named `PortalHost`.
styleStyleProp<ViewStyle>-NoStyle applied to the sheet surface.
scrimStyleStyleProp<ViewStyle>-NoStyle applied to the scrim. Ignored by the standard variant.
scrimAccessibilityLabelstringClose sheetNoScreen-reader label for the scrim's dismiss action.
dragHandleAccessibilityLabelstringDrag handleNoScreen-reader label for the drag handle.
testIDstring-NoTest id applied to the sheet surface.