BottomSheetUpdated

Displays a bottom sheet presented natively through TrueSheet — above everything, including native modals and formSheet screens.

Displays a bottom sheet presented natively — the sheet presentation controller on iOS and the native bottom sheet on Android — through @lodev09/react-native-true-sheet. The sheet appears above everything, including native modals and formSheet screens.

Installation

BottomSheet needs the TrueSheet package (an optional peer dependency of HeroUI Native):

npx expo install @lodev09/react-native-true-sheet

It is a native module, so rebuild the app after installing it. The presentation="bottom-sheet" modes of Popover, Select, and Menu use the same package.

Import

import { BottomSheet, type BottomSheetRef } from 'heroui-native';

Anatomy

<BottomSheet ref={sheetRef}>
  <BottomSheet.Content>
    <BottomSheet.Header>
      <BottomSheet.Title>...</BottomSheet.Title>
      <BottomSheet.Description>...</BottomSheet.Description>
      <BottomSheet.Close />
    </BottomSheet.Header>
    <BottomSheet.Body>...</BottomSheet.Body>
    <BottomSheet.Footer>...</BottomSheet.Footer>
  </BottomSheet.Content>
</BottomSheet>
  • BottomSheet: The sheet. Renders nothing until presented through its ref; content mounts on the first presentation.
  • BottomSheet.Content: Dialog container that pads the sheet and holds its parts. Any content works inside it; Header, Body, and Footer are optional.
  • BottomSheet.Header: Top section, usually the title, description, and close button. isSticky pins it while the content below scrolls.
  • BottomSheet.Body: Main section.
  • BottomSheet.Footer: Bottom section, usually the actions. isSticky pins it while the content above scrolls.
  • BottomSheet.Close: Close button that dismisses the sheet. Accepts custom children or renders the default close icon.
  • BottomSheet.Title: Sheet title with a heading role, linked to the sheet for accessibility.
  • BottomSheet.Description: Sheet description, linked to the sheet for accessibility.

Usage

Basic BottomSheet

The sheet is controlled through its ref: present(), resize(), dismiss(), and dismissStack().

const sheetRef = useRef<BottomSheetRef>(null);

<Button onPress={() => sheetRef.current?.present()}>Open</Button>
<BottomSheet ref={sheetRef}>
  <BottomSheet.Content>
    <BottomSheet.Header className="mb-8 gap-2">
      <BottomSheet.Title>Keep yourself safe</BottomSheet.Title>
      <BottomSheet.Description>
        Update your software to the latest version.
      </BottomSheet.Description>
    </BottomSheet.Header>
    <BottomSheet.Footer>
      <Button onPress={() => sheetRef.current?.dismiss()}>Later</Button>
    </BottomSheet.Footer>
  </BottomSheet.Content>
</BottomSheet>

Detents

detents lists the sizes the sheet can rest at, smallest first, up to 3. 'auto' (the default) sizes the sheet to its content, 'peek' to its header and footer, and a number is a fraction (0–1) of the available height.

<BottomSheet ref={sheetRef} detents={[0.4, 0.8]}>
  ...
</BottomSheet>;

sheetRef.current?.present(1); // open at the second detent
sheetRef.current?.resize(0); // move to the first detent

Controlling a Sheet by Name

You don't need a ref to control a sheet. Give it a unique name and control it from anywhere — another component, a store, a navigation listener — with the imperative TrueSheet API: present, resize, dismiss, dismissStack, and dismissAll.

Use the useTrueSheet() hook inside components. It works on every platform (on web it needs TrueSheetProvider, which HeroUINativeProvider already includes):

import { useTrueSheet } from '@lodev09/react-native-true-sheet';

function Controls() {
  const { present, resize, dismiss } = useTrueSheet();

  return (
    <>
      <Button onPress={() => present('filters')}>Open filters</Button>
      <Button onPress={() => resize('filters', 1)}>Expand</Button>
      <Button onPress={() => dismiss('filters')}>Close</Button>
    </>
  );
}

<BottomSheet name="filters" detents={[0.4, 0.8]}>
  ...
</BottomSheet>;

Outside React (stores, services, navigation callbacks), call the static methods on TrueSheet. They are native only — use the hook where web matters:

import { TrueSheet } from '@lodev09/react-native-true-sheet';

await TrueSheet.present('filters'); // first detent
await TrueSheet.present('filters', 1); // second detent
await TrueSheet.resize('filters', 0);
await TrueSheet.dismiss('filters');
await TrueSheet.dismissAll();

Every method returns a promise that resolves once the animation finishes, and throws if no mounted sheet has that name. Names must be unique across mounted sheets.

Blur Overlay

dimBlur blurs the screen behind the sheet instead of dimming it, with the same style names as iOS ('dark', 'light', 'system-ultra-thin-material-dark', …). dimOpacity sets the blur strength. Android 12+ blurs; older Android versions fall back to a tint.

<BottomSheet
  ref={sheetRef}
  dimBlur="system-ultra-thin-material-dark"
  dimOpacity={0.4}
>
  ...
</BottomSheet>

isSticky on BottomSheet.Header or BottomSheet.Footer pins it to the top or bottom of the sheet while the content in between scrolls. A sticky part renders in the sheet's native header / footer slot, and its height counts toward the auto detent. It must be a direct child of BottomSheet.Content; wrapped in another component it renders in place instead.

Put the scroll view in BottomSheet.Body and pass its ref as scrollableRef, so the sheet coordinates scrolling with dragging, insets, and the keyboard:

const scrollRef = useRef<ScrollViewInstance>(null);

<BottomSheet
  ref={sheetRef}
  detents={[0.6, 1]}
  scrollableRef={scrollRef}
  style={{ flex: 1 }}
>
  <BottomSheet.Content className="flex-1 px-0">
    <BottomSheet.Header isSticky className="pb-4">
      <BottomSheet.Title>Terms of Service</BottomSheet.Title>
    </BottomSheet.Header>
    <BottomSheet.Body className="flex-1">
      <ScrollView ref={scrollRef} contentContainerClassName="px-5">
        ...
      </ScrollView>
    </BottomSheet.Body>
    <BottomSheet.Footer isSticky>
      <Button onPress={() => sheetRef.current?.dismiss()}>Accept</Button>
    </BottomSheet.Footer>
  </BottomSheet.Content>
</BottomSheet>;

A sticky part takes the place of the header / footer props. Use those props directly for anything else in the slots, such as a footer that floats over the content (footerOptions={{ position: 'absolute' }}).

Text Input

The sheet moves with the keyboard on its own. To raise the keyboard together with the sheet, focus the input from onWillPresent:

const inputRef = useRef<InputRef>(null);
const handleWillPresent = useCallback(() => inputRef.current?.focus(), []);

<BottomSheet ref={sheetRef} onWillPresent={handleWillPresent}>
  <BottomSheet.Content>
    <TextField>
      <Input ref={inputRef} placeholder="name@example.com" />
    </TextField>
  </BottomSheet.Content>
</BottomSheet>;

Animating With the Sheet

useBottomSheetAnimation() returns the sheet's live Reanimated values. Call it inside the sheet content:

function SheetIcon() {
  const { progress } = useBottomSheetAnimation();
  const style = useAnimatedStyle(() => ({
    opacity: progress.get(),
    transform: [{ scale: interpolate(progress.get(), [0, 1], [0.4, 1]) }],
  }));

  return <Animated.View style={style}>...</Animated.View>;
}

The presentation="bottom-sheet" content of Popover, Select, and Menu renders inside a BottomSheet too, so the hook works there as well.

Sheets as Navigation Screens

To open sheets as routes, use TrueSheet's own navigator. With Expo Router:

// app/sheet/_layout.tsx
import { Sheet } from '@lodev09/react-native-true-sheet/navigation/expo-router';

export const unstable_settings = { anchor: 'index' };

export default function SheetLayout() {
  return (
    <Sheet>
      <Sheet.Screen name="index" />
      <Sheet.Screen
        name="details"
        options={{ reanimated: true, detents: ['auto'] }}
      />
    </Sheet>
  );
}

index renders as a regular screen and every other route is presented as a sheet. Use router.push() to open one and router.back() (or a drag down) to close it. Its root view shouldn't use flex: 1; the sheet sizes itself from its content. On Android, wrap a sheet route that uses gesture-handler components (such as Slider) in GestureHandlerRootView with flexGrow: 1; BottomSheet adds one itself. Navigator sheets are TrueSheet's own, so BottomSheet.Content, Title, and the other parts can't be used inside them. See TrueSheet's navigation guide for the React Navigation version.

Stacked Sheets

Presenting a sheet while another is open stacks it on top. dismiss() closes a sheet and every sheet stacked on it; dismissStack() closes only the sheets above it.

Dialogs and Toasts Above a Sheet

Dialog, Toast, and the floating Popover, Select, and Menu render in a native layer above any presented sheet, so they stay visible when opened from inside a sheet.

Example

import { BottomSheet, Button, type BottomSheetRef } from 'heroui-native';
import { useRef } from 'react';
import { View } from 'react-native';

export default function BottomSheetExample() {
  const sheetRef = useRef<BottomSheetRef>(null);

  return (
    <View className="flex-1 items-center justify-center">
      <Button variant="secondary" onPress={() => sheetRef.current?.present()}>
        Delete account
      </Button>
      <BottomSheet
        ref={sheetRef}
        onDidDismiss={() => console.log('sheet closed')}
      >
        <BottomSheet.Content>
          <BottomSheet.Header className="mb-8 gap-2">
            <BottomSheet.Title>Delete account?</BottomSheet.Title>
            <BottomSheet.Description>
              You won't be able to restore it or receive support.
            </BottomSheet.Description>
          </BottomSheet.Header>
          <BottomSheet.Footer className="gap-3">
            <Button
              variant="danger"
              onPress={() => sheetRef.current?.dismiss()}
            >
              Delete forever
            </Button>
            <Button
              variant="tertiary"
              onPress={() => sheetRef.current?.dismiss()}
            >
              Cancel
            </Button>
          </BottomSheet.Footer>
        </BottomSheet.Content>
      </BottomSheet>
    </View>
  );
}

API Reference

BottomSheet

Forwards every TrueSheet prop except onPositionChange (use useBottomSheetAnimation instead). The most common ones:

proptypedefaultdescription
childrenReact.ReactNode-Sheet content, usually a BottomSheet.Content
namestringauto idUnique name for controlling the sheet with useTrueSheet() / TrueSheet.present(name)
detents('auto' | 'peek' | number)[]['auto']Sizes the sheet can rest at, smallest first, up to 3
dimmedbooleantrueWhether the screen behind the sheet is dimmed
dimOpacitynumber0.5Dim (or blur) strength
dimBlurBackgroundBlur-Blurs the screen behind the sheet instead of dimming it
dismissiblebooleantrueWhether the sheet can be dismissed by dragging, tapping the dimmed area, or Android back
draggablebooleantrueWhether the sheet can be dragged
grabberbooleantrueWhether to show the grabber
backgroundColorColorValueoverlaySheet color. Defaults to the overlay theme color (native material under the glass theme)
backgroundBlurBackgroundBlur-Blurred sheet material (iOS)
headerReact.ReactNode-Content pinned to the top of the sheet. A sticky BottomSheet.Header takes its place
footerReact.ReactNode-Content pinned to the bottom of the sheet. A sticky BottomSheet.Footer takes its place
scrollableRefRefObject<ScrollViewInstance | …>-Ref of the scroll view inside the sheet
insetAdjustment'automatic' | 'never'-'never' stops the sheet from adding the bottom safe area
animationAnimationRootDisableAll-"disable-all" disables animations in the sheet content, including children
onWillPresent(event) => void-Called before the sheet is presented
onDidPresent(event) => void-Called after the sheet is presented
onDidDismiss(event) => void-Called after the sheet is dismissed, however it was dismissed
onDetentChange(event) => void-Called when the sheet settles at another detent

Ref methods (BottomSheetRef)

methoddescription
present(index?, animated?)Presents the sheet at the detent at index (default 0)
resize(index)Moves the presented sheet to the detent at index
dismiss(animated?)Dismisses the sheet and every sheet stacked on it
dismissStack(animated?)Dismisses only the sheets stacked on it

BottomSheet.Content

proptypedefaultdescription
childrenReact.ReactNode-Sheet content
classNamestring-Additional CSS classes
...ViewPropsViewProps-All standard React Native View props are supported

BottomSheet.Header

proptypedefaultdescription
childrenReact.ReactNode-Header content
isStickybooleanfalsePins the header to the top of the sheet while the content below scrolls. Must be a direct child of BottomSheet.Content
classNamestring-Additional CSS classes
...ViewPropsViewProps-All standard React Native View props are supported

BottomSheet.Body

proptypedefaultdescription
childrenReact.ReactNode-Body content
classNamestring-Additional CSS classes
...ViewPropsViewProps-All standard React Native View props are supported

BottomSheet.Footer

proptypedefaultdescription
childrenReact.ReactNode-Footer content
isStickybooleanfalsePins the footer to the bottom of the sheet while the content above scrolls. Must be a direct child of BottomSheet.Content
classNamestring-Additional CSS classes
...ViewPropsViewProps-All standard React Native View props are supported

BottomSheet.Close

proptypedefaultdescription
childrenReact.ReactNode-Custom close button content
onPress(event: GestureResponderEvent) => void-Called after the sheet starts dismissing
...CloseButtonPropsCloseButtonProps-All CloseButton props are supported

BottomSheet.Title

proptypedefaultdescription
childrenReact.ReactNode-Title content
classNamestring-Additional CSS classes
...TextPropsTextProps-All standard React Native Text props are supported

BottomSheet.Description

proptypedefaultdescription
childrenReact.ReactNode-Description content
classNamestring-Additional CSS classes
...TextPropsTextProps-All standard React Native Text props are supported

Hooks

useBottomSheetAnimation

Returns the live sheet values, updated on the UI thread. Must be called inside BottomSheet.

propertytypedescription
animatedPositionSharedValue<number>Y offset of the sheet's top edge from the top of the screen
animatedIndexSharedValue<number>Detent index as a continuous value (-1 while off screen)
animatedDetentSharedValue<number>Current detent as a fraction (0–1) of the available height
progressDerivedValue<number>0 while off screen, 1 once at rest, in between while moving

Migrating from the previous BottomSheet

The previous BottomSheet was built on @gorhom/bottom-sheet, which is no longer used.

BeforeNow
isOpen / onOpenChange / BottomSheet.Triggerref.present() / ref.dismiss() and onDidDismiss
BottomSheet.Portal, BottomSheet.OverlayNot needed: the sheet presents natively and dims (or blurs) itself
BottomSheet.Content sheet propsProps on BottomSheet itself; className stays on Content
snapPoints={['40%', '80%']}detents={[0.4, 0.8]}
enableDynamicSizingdetents={['auto']} (the default)
enablePanDownToClose={false}dismissible={false}
BottomSheetScrollView / BottomSheetFlatListScrollView / FlatList plus scrollableRef
BottomSheetFooter / footerComponent<BottomSheet.Footer isSticky> or the footer prop
useBottomSheetAwareHandlersRemoved: the sheet handles the keyboard natively
useBottomSheet()Removed: keep a ref to the sheet

On this page

Build faster with HeroUI ProComponents, templates & AI toolingExplore Pro