SafeAreaView renders content within the safe area boundaries of a device, avoiding notches, status bars, and home indicators.
One provides safe area support via a lightweight implementation for web (@vxrn/safe-area) and uses react-native-safe-area-context on native. The web implementation is optimized for bundle size and doesn’t require native module dependencies.
app/_layout.tsx
SafeAreaView extends all standard View props and adds:
| Prop | Type | Default | Description |
|---|---|---|---|
mode | 'padding' | 'margin' | 'padding' | How to apply the safe area insets |
edges | Edge[] | All edges | Which edges to apply insets to |
Get the current safe area insets for custom layouts:
Returns { top, right, bottom, left } in pixels.
@vxrn/safe-area) that reads CSS env(safe-area-inset-*) values. This is automatically aliased from react-native-safe-area-context on web, reducing bundle size while maintaining full API compatibility.react-native-safe-area-context, accounting for status bar, notch/Dynamic Island, and home indicatorOne automatically sets up SafeAreaProvider - no additional setup needed.
Edit this page on GitHub.