This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 54).
A SwiftUI BottomSheet component that presents content from the bottom of the screen.
iOS
tvOS
A bottom sheet component that slides up from the bottom of the screen to present content.
Installation
Terminal
- npx expo install @expo/uiIf you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
import { BottomSheet, Host, Text } from '@expo/ui/swift-ui'; import { useWindowDimensions } from 'react-native'; const { width } = useWindowDimensions(); <Host style={{ position: 'absolute', width }}> <BottomSheet isOpened={isOpened} onIsOpenedChange={e => setIsOpened(e)}> <Text>Hello, world!</Text> </BottomSheet> </Host>
See official SwiftUI documentation for more information.
API
Component
Type: React.Element<BottomSheetProps>
Optional • Type:
booleanSetting it to true will disable the interactive dismiss of the BottomSheet.
Type:
(isOpened: boolean) => voidCallback function that is called when the BottomSheet is opened.
Optional • Type:
PresentationDetent[]Array of presentation detents for the BottomSheet.
Controls the heights that the sheet can snap to.
medium- Medium height sheetlarge- Full height sheet- number (0-1) - Fraction of screen height (for example, 0.4 equals to 40% of screen)
Optional • Type:
PresentationDragIndicatorVisibilityControls the visibility of the drag indicator for the BottomSheet.
automatic- System decides based on context (default)visible- Always show the drag indicatorhidden- Never show the drag indicator