npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-safe-edges

v1.0.0

Published

Device-aware edge insets for React Native — static dimension map + safe-area-context hook

Readme

@junioorpl/react-native-safe-edges

Device-aware edge insets for React Native. Two APIs, one package — pick what fits your app.

Install

npm install @junioorpl/react-native-safe-edges

For the hook API, also install:

npm install react-native-safe-area-context

APIs

Static API — getStaticEdges(), TOP, BOTTOM

Uses a built-in device dimension map. Values resolve once at module load.

import { TOP, BOTTOM } from '@junioorpl/react-native-safe-edges';

<View style={{ marginTop: TOP, paddingBottom: BOTTOM }}>
  <Text>Content</Text>
</View>

Or get full device info:

import { getStaticEdges } from '@junioorpl/react-native-safe-edges';

const { top, bottom, model } = getStaticEdges();
// model → "iPhone 16 Pro Max"

Hook API — useSafeEdges()

Uses react-native-safe-area-context for runtime detection. Requires <SafeAreaProvider> wrapping your app.

import { useSafeEdges } from '@junioorpl/react-native-safe-edges';

function Screen() {
  const { top, bottom, left, right } = useSafeEdges();

  return (
    <View style={{ paddingTop: top, paddingBottom: bottom }}>
      <Text>Content</Text>
    </View>
  );
}

Which API should I use?

| | Static API | Hook API | |---|---|---| | Dependencies | None (just react-native) | react-native-safe-area-context | | Resolution | Module load (once) | Runtime (reactive) | | Landscape support | No | Yes | | New device support | Needs package update | Automatic | | Works outside React | Yes | No (hook) | | Accuracy | Per-model lookup table | Native system values | | Setup | Zero config | Requires <SafeAreaProvider> |

Use Static when: you need simple top/bottom offsets, want zero setup, or need values outside the React tree (navigation config, style constants).

Use Hook when: you need runtime accuracy, landscape support, or want automatic support for future devices without waiting for a package update.

Both are fine to use in the same app. Common pattern: static for navigation/layout constants, hook for screen-level adaptive padding.

Supported Devices

iOS (dimension map)

| Dimensions | Models | |---|---| | 375×667 | iPhone 8, SE (2nd & 3rd gen) | | 414×736 | iPhone 8 Plus | | 375×812 | iPhone X, XS, 11 Pro, 12 Mini, 13 Mini | | 414×896 | iPhone XR, XS Max, 11, 11 Pro Max | | 390×844 | iPhone 12, 12 Pro, 13, 13 Pro, 14, 15, 16, 16e | | 428×926 | iPhone 12/13 Pro Max, 14 Plus, 15 Plus, 16 Plus | | 393×852 | iPhone 14 Pro, 15 Pro, 16 Pro | | 430×932 | iPhone 14 Pro Max, 15 Pro Max, 16 Pro Max | | 402×874 | iPhone 17, 17 Pro | | 420×912 | iPhone 17 Air | | 440×956 | iPhone 17 Pro Max |

Android

Uses StatusBar.currentHeight from React Native (no hardcoded values).

Keeping this package updated

New iPhone? New dimensions? Open an issue or PR:

  1. Add the entry to src/devices.ts
  2. Update the table above
  3. Bump minor version

https://github.com/junioorpl/react-native-safe-edges/issues

License

MIT