Repository navigation
v0.18.0-next.4
Pre-releaseOverview
- addressed: #18, #52
- external contributors: @dkulakov, @falcondpr
Changes
-
Added floating cards to
BottomSheetandModalBottomSheet. Each detent can setleft,right, andbottominsets. The gaps change smoothly as you drag, and taps in the gaps reach the scrim or the view behind the sheet. -
Added
surfaceStylefor corner radii and shadows. The sheet clips both its background and its content to the same shape.borderCurveis iOS-only, andelevationis Android-only. -
Added accessible dismissal to
ModalBottomSheet. When tapping the scrim would close the sheet, screen readers can activate its Dismiss button. VoiceOver users can also perform the escape gesture on iOS, and TalkBack users can invoke the Dismiss action from inside the sheet on Android. These actions select the closed detent directly. UsescrimAccessibilityLabelto localize the label. -
Changed modal stacking so the most recently opened or reopened sheet appears on top.
nativeOverlaysheets stay above portal sheets. Android back and supported Escape-key requests go to the topmost eligible sheet. -
Changed
lazyto unmount the sheet’s native view along with its content once the closing animation settles. While unmounted, the sheet emits noonPositionChangeevents. -
Fixed iOS scroll handoff when a drag reverses direction. With
handoffenabled for the new direction, the same touch can expand or collapse the sheet after a bounce or pull-to-refresh clears. A touch that interrupts a snap without moving the sheet now lets the snap resume. -
Fixed an iOS issue where a recycled modal sheet could reopen with the wrong scrim opacity.
Migrating from 0.18.0-next.3
-
Check the peer dependencies:
0.18.0-next.4requires React Native0.82.0or later and React19.1.1or later. -
Move modal scrim opacity onto each detent and remove the
programmaticimport: Replaceprogrammatic(value)with{ value, programmatic: true }. Replace thescrimOpacitiesarray withscrimOpacityon the corresponding detents. Bare numbers, percentages, and'content'still work. An omitted opacity defaults to0for a closed detent and1for an open one.// Before: detents={[0, programmatic(320), '100%']} scrimOpacities={[0, 0.4]} // After: detents={[ 0, { value: 320, programmatic: true, scrimOpacity: 0.4 }, { value: '100%', scrimOpacity: 0.4 }, ]}
The old array reused its last entry for later detents. Repeat that value wherever you relied on it. For a separately typed modal detent array that uses
scrimOpacity, useModalDetent[]. -
Replace
extendUnderStatusBarwithtopInset: UsetopInset={0}where you previously passedextendUnderStatusBar={true}. If you passedfalse, omittopInsetto keep the default status-bar clearance.topInsetapplies to every detent. Put side and bottom gaps in each detent’sinsetsobject. -
Move corner radii and shadows from
surfacetosurfaceStyle: Keep the visual fill onsurface, such as a background color, image, or gradient. Move the existing corner radii tosurfaceStyleso the sheet clips both the fill and its content to the same outline. Move shadow styles there as well so the shadow can draw outside the card. This applies to bothBottomSheetandModalBottomSheet.surface={ <View style={[StyleSheet.absoluteFill, { backgroundColor: 'white' }]} /> } surfaceStyle={{ borderTopLeftRadius: 24, borderTopRightRadius: 24, boxShadow: '0 -4 16 rgba(0, 0, 0, 0.2)', }}
If your
surfacealready provides only the fill, no change is needed. -
Rename
scrollableNegotiationtoscrollCoordination: Keep your existing mode or{ expand, collapse }value. Rename the exported typesScrollableNegotiationandScrollableNegotiationModetoScrollCoordinationandScrollCoordinationMode. If you used the deprecateddisableScrollableNegotiationflag, replacetruewithscrollCoordination="none"or omit the prop forfalse.