Repository navigation
v0.2.0 — gorhom parity
Everything @gorhom/bottom-sheet does that a user can see or feel, on the native frame. Sheets ported from gorhom keep their prop names and, from this release, their defaults.
Stacking
stackBehavior—'switch'(default: the sheet on top slides out with its content still mounted and comes back when the new one is dismissed),'push','replace'. No provider needed.name,useBottomSheetModal().dismiss(name?)/dismissAll(), anddismissAllSheets()outside React.- Ref gains
minimize()/restore().
Animated values (Reanimated, optional)
- Native
onPositionChangeemits the sheet's live position per frame, armed only while something listens. - A
useEventworklet writes it into shared values on the UI thread:animatedIndex/animatedPositionprops,useBottomSheetAnimated(), and gorhom'suseBottomSheet()shape. - Reanimated stays an optional peer; without it the same objects update when the sheet settles.
Modal mode
mode="modal"(or acontainerComponent) attaches to React Native's root surface view, above every screen, with React touches intact.
Sizing and gestures
- Detents are sorted by resolved height, so a content-sized detent lands wherever the content puts it (gorhom's dynamic-sizing rule). Every index refers to that order.
maxDynamicContentSize,snapToPosition(dp | '50%'),forceClose.enableContentPanningGesture,enableHandlePanningGesture.enableOverDrag/overDragResistanceFactorwith gorhom's exactsqrt(1 + excess) × factorcurve, from the handle or a body without a list.detachedwithstyleside margins ordetachedMargin, all corners rounded.- Custom
handleComponent, rendered natively in asheet-handleslot and given the animated values. presentOnMount/animateOnMountfor gorhom's non-modalBottomSheet.
Keyboard
keyboardBehavior="interactive"(keyboardMode="lift-sheet") is now hybrid: whatever the sheet cannot rise, the footer rises on its own, so a footer always clears the keyboard.keyboardBlurBehavior="restore"returns to the pre-keyboard detent.enableBlurKeyboardOnGesture(aliasdismissKeyboardOnDrag).- New
contentBottomInset: the content's own safe-area padding is spent over the keyboard instead of stacking on top of it.
Events
onChange(index, position, type)withSNAP_POINT_TYPE.PROVIDED | DYNAMIC.onAnimate(from, to, fromPosition, toPosition).onClosealias ofonDismiss.
Accessibility and motion
- VoiceOver / TalkBack labels on the backdrop and handle; the handle is an adjustable control that moves between detents.
- Reduce Motion (iOS) and animator duration scale (Android) shorten the springs.
Also in this release (from 0.1.1)
- Android: the hardware back press is claimed in JS while presented, so back closes the sheet instead of leaving the screen.
⚠️ Breaking: defaults now match gorhom 5.x
| 0.1.x | 0.2.0 | |
|---|---|---|
enableDynamicSizing |
false |
true |
enableOverDrag |
false |
true (2.5) |
keyboardBehavior |
expand to top | 'interactive' |
dismissKeyboardOnDrag |
true |
false |
| background | system, radius 24 | white, radius 15 |
| handle | 36×5 | 7.5% of the window × 4, 24dp area |
Migration: sheets with fixed detents that must not gain a content-sized detent need enableDynamicSizing={false}; an Instagram-style comments sheet wants keyboardBehavior="extend" and dismissKeyboardOnDrag. The backdrop keeps BottomSheetBackdrop's defaults (black, 0.5, close on press); pass backdropOpacity={0} for gorhom's bare default.
Not covered
Custom backdropComponent (accepted, not rendered), gorhom's footerComponent render prop, Reanimated animationConfigs, and RNGH simultaneousHandlers / waitFor.
Full Changelog: v0.1.0...v0.2.0