Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-safe-area-context

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-safe-area-context

A flexible way to handle safe area, also works on Android and web.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
678K
decreased by-42.61%
Maintainers
1
Weekly downloads
 
Created

What is react-native-safe-area-context?

The react-native-safe-area-context package provides a way to handle safe area insets in a React Native application. It helps to ensure that content is not obscured by device notches, status bars, or other screen elements.

What are react-native-safe-area-context's main functionalities?

SafeAreaProvider

The SafeAreaProvider component is used to wrap the entire application or a part of it to provide safe area insets to its children.

import { SafeAreaProvider } from 'react-native-safe-area-context';

const App = () => {
  return (
    <SafeAreaProvider>
      {/* Your app content */}
    </SafeAreaProvider>
  );
};

useSafeAreaInsets

The useSafeAreaInsets hook provides the current safe area insets, which can be used to adjust the layout of components to avoid overlaps with device notches or status bars.

import { useSafeAreaInsets } from 'react-native-safe-area-context';

const MyComponent = () => {
  const insets = useSafeAreaInsets();

  return (
    <View style={{ paddingTop: insets.top }}>
      {/* Your component content */}
    </View>
  );
};

SafeAreaView

The SafeAreaView component is a view that automatically applies safe area insets as padding to its children, ensuring that content is not obscured by device notches or status bars.

import { SafeAreaView } from 'react-native-safe-area-context';

const MyScreen = () => {
  return (
    <SafeAreaView style={{ flex: 1 }}>
      {/* Your screen content */}
    </SafeAreaView>
  );
};

Other packages similar to react-native-safe-area-context

Keywords

FAQs

Package last updated on 19 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc