Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 856 Bytes

File metadata and controls

27 lines (22 loc) · 856 Bytes

react-native-app-helpers/HorizontallySymmetricalSafeAreaView

Similar to SafeAreaView, but ensures that the left and right safe area insets are identical. This means that, for example, the notch will not push a tab bar's contents off-center when the device is horizontal.

This uses [react-native-safe-area-context]https://github.com/th3rdwave/react-native-safe-area-context)'s useSafeAreaInsets, so its instructions (such as adding a <SafeAreaProvider>) must be followed.

Usage

import { HorizontallySymmetricalSafeAreaView } from "react-native-app-helpers";

const ExampleScreen = () => (
  <HorizontallySymmetricalSafeAreaView
    top bottom left right
  >
    <Text>
      This is inside a SafeAreaView-like element, where the left and right
      paddings are identical.
    </Text>
  </HorizontallySymmetricalSafeAreaView>
);