Safe Area
Cross-platform viewport safe area container respecting notch and navigation bar insets.
v0.1.1NativeWindStyleSheetiOSAndroidExpo GoWeb
Preview
Installation
npx nativra-cli add safe-areaWrites SafeArea.tsx to components/ui, rewrites imports to your aliases and records hashes in nativra.lock.json, along with 2 registry dependencies. Existing files are never overwritten without asking.
Want to try it first? Open it in the playground: a real React Native project in your browser, with this item installed by the CLI.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| edges | Array<"top" | "bottom" | "left" | "right"> | ["top", "bottom", "left", "right"] | Window insets to respect |
| backgroundColor | string | "transparent" | Surface background color |
| children | React.ReactNode | required | Safe area protected content |
Source
Exactly what the CLI writes, before your import aliases are applied.
Dependencies
Registry items
- useThemeColorsHookReturns the installed theme's semantic colors for the current light/dark scheme, and the installed style's tokens and helpers. Used by every component.
- Class Names UtilityUtilityUtility function for conditionally merging class names with clsx and tailwind-merge (NativeWind) or flattening style objects (StyleSheet).
npm packages
- react-native-safe-area-context>=4.10.0peer
Used by
- Booking FlowTemplateAppointment booking in three steps: date and free time slots, contact details with phone, a summary to confirm, then a success screen.
- Profile FlowTemplateProfile screen with avatar, bio, stats and grouped settings, plus an edit mode with validation, photo change and async save.
- Social FeedTemplateInfinite-scroll feed with post cards, optimistic likes, comments and native share, pull to refresh, and error and end states.