Skip to content

Releases

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 16 Nov 11:19
e6c75bc

Overview

Changes

  • Added maxWidth and placement to BottomSheet and ModalBottomSheet on iOS, Android, and web. Both props can change while the sheet is open.
    • Set maxWidth to cap the sheet’s width in points, including the detent’s side insets. Narrower containers still use their available width. Omit maxWidth or pass Infinity for no cap.
    • Set placement to align the sheet when the cap leaves extra space. The default is 'center'. Use 'start' or 'end' to align it with the corresponding edge in the current layout direction.
  • Reduced stuttering on iOS while a sheet animates to a detent.
  • Fixed a final-frame jump on iOS, Android, and web. The sheet now slows to a stop at its target detent, most noticeably when opening from closed to full height.

v1.1.0-next.2

v1.1.0-next.2 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 15 Nov 15:41
03cefc0

Overview

Changes

  • Fixed a final-frame jump as the sheet settled on a detent on iOS, Android, and web. The sheet now slows smoothly to a stop at the target, most noticeably when opening from closed to full height.

v1.1.0-next.1

v1.1.0-next.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 14 Nov 12:31
bb76e9c

Overview

Changes

  • Added maxWidth and placement to BottomSheet and ModalBottomSheet, so a sheet doesn’t stretch across a tablet, foldable, desktop browser, or phone in landscape.
    • maxWidth caps the sheet’s width in points, including its detent’s side insets. The card fills a column up to maxWidth wide, between its insets, as it would on a screen that wide. A screen narrower than maxWidth is filled as before. Leave it unset, or pass Infinity, for no cap.
    • placement positions a sheet that maxWidth makes narrower than its host: 'center' (the default), 'start', or 'end'. 'start' and 'end' follow the layout direction, like a detent’s start and end insets.
    • Both can change while the sheet is open.
  • Fixed stuttering on iOS while a sheet animates to a detent.

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 14:29
7b48a4b

Changes

  • Changed nativeOverlay to windowOverlay on ModalBottomSheet. The behavior is the same.

  • Changed settleDuration from seconds to milliseconds. The default is 450. In development, a value below 10 logs a warning, since it is likely a leftover value in seconds.

  • Changed close requests on ModalBottomSheet so one rule covers every way of asking a sheet to close without dragging it: a scrim tap, a screen reader’s dismiss action, Android system back, and Escape on Android and the web.

    • With onCloseRequest, each of these only calls the handler. The sheet does not move, so the handler can confirm first, close a sheet that has no closed detent, or ignore the request.

    • Without onCloseRequest, each of these snaps the sheet to its closed detent and reports it through onIndexChange. This requires a visible scrim and a closed detent that is not programmatic.

    • Dragging the sheet closed is unchanged and always reports through onIndexChange.

  • Added onCloseRequest support on iOS. It is called for scrim taps, the scrim’s Dismiss button, and the VoiceOver escape gesture.

  • Changed the default for Android system back and for Escape on Android and the web. A modal sheet without onCloseRequest now closes instead of letting the input pass to the app, and keeps consuming it until the closing animation finishes.

  • Changed Escape routing on the web to match Android. The top modal sheet blocks the sheets it covers even when it does not act on Escape.

  • Added start and end to a detent’s insets. They follow the layout direction and take precedence over left or right, whichever they resolve to. On the web, the layout direction is the document’s.

  • Fixed start and end corner radii in surfaceStyle on the web in right-to-left documents.

  • Changed scrimColor to accept any ColorValue, including PlatformColor and DynamicColorIOS.

  • Changed the type of wrapNativeView so it no longer exposes the internal native props. Passing Animated.createAnimatedComponent works as before.

  • Added the BottomSheetProviderProps type export.

  • Added react-dom and react-native-web as optional peer dependencies.

Migrating from 0.18.1

  1. Rename nativeOverlay to windowOverlay: Keep the value you passed.

  2. Convert settleDuration to milliseconds: Multiply your value by 1000.

    // 0.18.1
    settleDuration={0.55}
    
    // 1.0.0
    settleDuration={550}
  3. Review sheets that use onCloseRequest: The handler now also receives scrim taps and screen reader dismiss actions, on every platform including iOS, and the sheet no longer closes by itself for those. If your handler does not already close the sheet, set index to the closed detent in it.

    onCloseRequest={() => setIndex(0)}
  4. Review modal sheets without onCloseRequest: Android system Back and Escape now close the sheet. To keep the sheet open, add an onCloseRequest handler that does nothing, or make the closed detent programmatic.

  5. Update typed wrapNativeView wrappers: If you annotated the wrapper’s parameter with the native props type, use ComponentType<any>.

v0.18.1

Choose a tag to compare

@github-actions github-actions released this 12 Nov 15:26
155a0e1

Overview

Changes

  • Fixed screen reader navigation for ModalBottomSheet when presented through the default portal. VoiceOver on iOS and TalkBack on Android skip the screen and any sheets behind the topmost sheet. Closing it makes the newly uncovered content accessible again.
  • Fixed an iOS gesture that left a partially expanded sheet in place. When the list is at its top, dragging the vertical scroll indicator upward can now expand the sheet.
  • Fixed vertical scroll indicator sizing on iOS and Android 10 or later. The indicator now fits the visible portion of the list as the sheet expands or collapses.

v0.18.0

Choose a tag to compare

@github-actions github-actions released this 10 Nov 13:36
8b80a69

Overview

Changes

  • Added web support for BottomSheet and ModalBottomSheet. Install react-dom and react-native-web alongside the library to use sheets on the web.

  • Added floating cards. Each detent can set left, right, and bottom gaps through insets. The gaps change smoothly as the sheet moves between detents. Taps in the gaps reach the modal scrim or the view behind an inline sheet.

  • Added surfaceStyle for corner radii and shadows. The sheet clips its background and content to the same outline while allowing the shadow to extend beyond it. borderCurve is iOS-only, and elevation is Android-only.

  • Added lazy to both sheet components. When enabled, the sheet mounts before opening and unmounts after the closing animation finishes. Reopening mid-animation preserves content state. Reopening after a full close starts with fresh state. An unmounted sheet emits no onPositionChange events. lazy defaults to false and only applies when there is a closed detent.

  • Added settleDuration to both sheet components. It accepts a finite duration greater than 0, in seconds. Animations that start from rest take the full duration. The default is 0.45 seconds on all platforms, up from about 0.2 seconds on Android.

  • Improved snapping on all platforms. A gentle swipe can reach the next detent before crossing the midpoint. Pausing before release selects the nearest detent. A fast flick carries its speed into the animation and can reach the target before settleDuration without overshooting.

  • Added accessible dismissal for ModalBottomSheet. When tapping the scrim would close the sheet, screen reader users can activate its Dismiss button, perform the VoiceOver escape gesture on iOS, or invoke the TalkBack Dismiss action on Android. These actions select the closed detent directly. Use scrimAccessibilityLabel to localize the button label.

  • Changed modal stacking so the most recently opened or reopened sheet appears on top. nativeOverlay sheets stay above portal sheets. Android back and Escape on Android and web route to the topmost eligible sheet.

  • Fixed Android system back bypassing onCloseRequest on portal sheets. This could send the app to the background on Android 10 while the sheet was open.

  • Fixed drags that start sideways or diagonally inside a vertical scrollable on iOS and Android. They now respect scrollCoordination. Horizontal scrollables still handle sideways gestures.

  • Fixed scroll handoff on iOS when a drag reverses direction. With handoff enabled for the new direction, the same touch can move 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 modal sheet could reopen with the wrong scrim opacity.

Migrating from 0.17.1

  1. Check the minimum versions: 0.18.0 requires React Native 0.82.0 or later and React 19.1.1 or later.

  2. Move detent options into detents: Remove the programmatic import and replace programmatic(value) with { value, programmatic: true }. Replace scrimOpacities with scrimOpacity on each corresponding modal detent. The old array reused its last entry for later detents, so repeat that value wherever you relied on it. An omitted opacity defaults to 0 for a closed detent and 1 for an open one. For explicitly typed arrays containing scrimOpacity, use ModalDetent[].

    // 0.17.1
    detents={[0, programmatic(320), '100%']}
    scrimOpacities={[0, 0.4]}
    
    // 0.18.0
    detents={[
      0,
      { value: 320, programmatic: true, scrimOpacity: 0.4 },
      { value: '100%', scrimOpacity: 0.4 },
    ]}
  3. Replace extendUnderStatusBar with topInset: Use topInset={0} where you previously passed extendUnderStatusBar={true}. If you passed false, omit topInset to keep the default status-bar clearance.

  4. Move corner radii and shadows from surface to surfaceStyle: Keep the background color, image, or gradient on surface.

  5. Rename scrollableNegotiation to scrollCoordination: Keep your existing mode or { expand, collapse } value. Rename ScrollableNegotiation and ScrollableNegotiationMode to ScrollCoordination and ScrollCoordinationMode. If you used disableScrollableNegotiation={true}, replace it with scrollCoordination="none". If you passed false, omit the prop.

v0.18.0-next.5

v0.18.0-next.5 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 Nov 16:58
e152c65

Overview

Changes

  • Added settleDuration to BottomSheet and ModalBottomSheet to control how long the sheet takes to settle at a detent. It accepts a finite number greater than 0, in seconds. The default is 0.45 seconds on iOS, Android, and web. Android previously settled in about 0.2 seconds.
  • Improved detent selection on all platforms. A gentle swipe up or down can now reach the next detent before crossing the midpoint. If you pause before lifting your finger, the sheet snaps to the nearest detent.
  • Improved fast flicks on all platforms. The sheet carries its release speed toward the target detent and can arrive before settleDuration without overshooting. Animations that start from rest, such as programmatic index changes, take the full duration.

v0.18.0-next.4

v0.18.0-next.4 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 07 Nov 17:40
7031d2b

Overview

Changes

  • Added floating cards to BottomSheet and ModalBottomSheet. Each detent can set left, right, and bottom insets. The gaps change smoothly as you drag, and taps in the gaps reach the scrim or the view behind the sheet.

  • Added surfaceStyle for corner radii and shadows. The sheet clips both its background and its content to the same shape. borderCurve is iOS-only, and elevation is 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. Use scrimAccessibilityLabel to localize the label.

  • Changed modal stacking so the most recently opened or reopened sheet appears on top. nativeOverlay sheets stay above portal sheets. Android back and supported Escape-key requests go to the topmost eligible sheet.

  • Changed lazy to unmount the sheet’s native view along with its content once the closing animation settles. While unmounted, the sheet emits no onPositionChange events.

  • Fixed iOS scroll handoff when a drag reverses direction. With handoff enabled 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

  1. Check the peer dependencies: 0.18.0-next.4 requires React Native 0.82.0 or later and React 19.1.1 or later.

  2. Move modal scrim opacity onto each detent and remove the programmatic import: Replace programmatic(value) with { value, programmatic: true }. Replace the scrimOpacities array with scrimOpacity on the corresponding detents. Bare numbers, percentages, and 'content' still work. An omitted opacity defaults to 0 for a closed detent and 1 for 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, use ModalDetent[].

  3. Replace extendUnderStatusBar with topInset: Use topInset={0} where you previously passed extendUnderStatusBar={true}. If you passed false, omit topInset to keep the default status-bar clearance. topInset applies to every detent. Put side and bottom gaps in each detent’s insets object.

  4. Move corner radii and shadows from surface to surfaceStyle: Keep the visual fill on surface, such as a background color, image, or gradient. Move the existing corner radii to surfaceStyle so 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 both BottomSheet and ModalBottomSheet.

    surface={
      <View style={[StyleSheet.absoluteFill, { backgroundColor: 'white' }]} />
    }
    surfaceStyle={{
      borderTopLeftRadius: 24,
      borderTopRightRadius: 24,
      boxShadow: '0 -4 16 rgba(0, 0, 0, 0.2)',
    }}

    If your surface already provides only the fill, no change is needed.

  5. Rename scrollableNegotiation to scrollCoordination: Keep your existing mode or { expand, collapse } value. Rename the exported types ScrollableNegotiation and ScrollableNegotiationMode to ScrollCoordination and ScrollCoordinationMode. If you used the deprecated disableScrollableNegotiation flag, replace true with scrollCoordination="none" or omit the prop for false.

v0.18.0-next.3

v0.18.0-next.3 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Nov 08:50
d83d35a

Overview

  • addressed: #46

Changes

  • Added an optional lazy prop to BottomSheet and ModalBottomSheet, defaulting to false. When this is enabled, children and surface mount before opening and unmount after the closing animation finishes. Reopening during closing preserves the mounted content; reopening after a full close resets its state. Has no effect when no detent is closed.

v0.18.0-next.2

v0.18.0-next.2 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 28 Oct 12:49
c77a260

Overview

Changes

  • Fixed Android system back bypassing onCloseRequest for portal ModalBottomSheet presentations on legacy back paths, causing the application to exit or move to the background instead of letting the sheet handle the request.
  • Fixed iOS and Android drags that start sideways or diagonally inside a vertical scrollable scrolling the content instead of expanding or collapsing the sheet. These gestures now follow scrollableNegotiation, while horizontal scrollables retain sideways gestures.