Gathering detailed insights and metrics for react-native-safe-area-view
Gathering detailed insights and metrics for react-native-safe-area-view
Gathering detailed insights and metrics for react-native-safe-area-view
Gathering detailed insights and metrics for react-native-safe-area-view
react-native-safe-area-context
A flexible way to handle safe area, also works on Android and web.
@react-native-oh-tpl/react-native-safe-area-context
A flexible way to handle safe area, also works on Android and web.
@ohmi/react-native-safe-area-view
JS only version of SafeAreaView for supporting iPhone X safe area insets.
react-native-safe-area-plus
A flexible way to handle safe area, also works on Android and iOS
⚠️ Deprecated: use the successor react-native-safe-area-context instead!
npm install react-native-safe-area-view
Typescript
Module System
Node Version
NPM Version
TypeScript (38.79%)
Java (21.14%)
Objective-C (14.54%)
Ruby (9.27%)
JavaScript (8.54%)
Starlark (7.73%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
659 Stars
136 Commits
180 Forks
10 Watchers
3 Branches
45 Contributors
Updated on Mar 15, 2025
Latest Version
1.1.1
Package Id
react-native-safe-area-view@1.1.1
Size
15.84 kB
NPM Version
6.13.4
Node Version
12.16.1
Published on
Apr 25, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
This library provides automatic padding when a view intersects with a safe area (notch, status bar, home indicator).
expo install react-native-safe-area-view react-native-safe-area-context
yarn add react-native-safe-area-view react-native-safe-area-context
Next, you need to link react-native-safe-area-context
. If you are using autolinking, run pod install
again. If not, follow these instructions. Then re-build your app binary.
First you need to wrap the root of your app with the SafeAreaProvider
.
1import * as React from 'react'; 2import { SafeAreaProvider } from 'react-native-safe-area-context'; 3import MyAwesomeApp from './src/MyAwesomeApp'; 4 5export default function App() { 6 return ( 7 <SafeAreaProvider> 8 <MyAwesomeApp /> 9 </SafeAreaProvider> 10 ); 11}
Now you can wrap components that touch any edge of the screen with a SafeAreaView
.
1import SafeAreaView from 'react-native-safe-area-view'; 2 3export default function MyAwesomeApp() { 4 return ( 5 <SafeAreaView style={{ flex: 1 }}> 6 <View style={{ flex: 1 }}> 7 <Text> 8 Look, I'm safe! Not under a status bar or notch or home indicator or 9 anything! Very cool 10 </Text> 11 </View> 12 </SafeAreaView> 13 ); 14}
Sometimes you will observe unexpected behavior and jank because SafeAreaView uses onLayout
then calls measureInWindow
on the view. If you know your view will touch certain edges, use forceInset
to force it to apply the inset padding on the view.
1<SafeAreaView forceInset={{ top: 'always' }}> 2 <View> 3 <Text>Yeah, I'm safe too!</Text> 4 </View> 5</SafeAreaView>
forceInset
takes an object with the keys top | bottom | left | right | vertical | horizontal
and the values 'always' | 'never'
. Or you can override the padding altogether by passing an integer.
Sometimes it's useful to know what the insets are for the top, right, bottom, and left of the screen. See the documentation for react-native-safe-area-context for more information.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 5/15 approved changesets -- score normalized to 3
Reason
project is archived
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
70 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More