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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-notchclear

v1.0.2

Published

to complete react-native notch issue on ios, android

Downloads

8

Readme

react-native-notchclear

to complete react-native notch issue on ios, android (It also supports expo.)

It is a library that can solve all the notch area problems that occur in android and ios.

android ios

Screenshot_20211125-152021_Expo Go, IMG-1147

Installation

This library use react-native-safe-area-context, so you need to install it.

react-native-cli

npm install react-native-safe-area-context
or
yarn add react-native-safe-area-context

expo

expo install react-native-safe-area-context

And then execute the command to install react-native-notchclear.

react-native-cli

npm install react-native-notchclear --save
or
yarn add react-native-notchclear

expo

expo install react-native-notchclear

How to use

Import react-native-notchclear.

import { NotchView, NotchProvider } from "react-native-notchclear";

first in your App.js add NotchProvider

First, add Notch Provider to your App.js file. After that, all additional operations such as navigation should be done within this system.


App.js

import React from "react";
import { StyleSheet, Text, View } from "react-native";

import { NotchView, NotchProvider } from "react-native-notchclear";
export default function App() {
  return <NotchProvider>//Just add additional code here</NotchProvider>;
}

android, ios

Screenshot_20211125-152201_Expo Go, IMG-1148

import React from "react";
import { StyleSheet, Text, View } from "react-native";

import { NotchView, NotchProvider } from "react-native-notchclear";
export default function App() {
  return (
    <NotchProvider>
      <NotchView>
        <Text>12312312312321312312</Text>
      </NotchView>
    </NotchProvider>
  );
}

The default color is all white. But there is still more.


android, ios

Screenshot_20211125-152021_Expo Go, IMG-1147

import React from "react";
import { StyleSheet, Text, View } from "react-native";

import { NotchView, NotchProvider } from "react-native-notchclear";
export default function App() {
  return (
    <NotchProvider>
      <NotchView top="#ff0000" bottom="#00ff00" main="#ffffff">
        <Text>12312312312321312312</Text>
      </NotchView>
    </NotchProvider>
  );
}

top is the color of the top area main is the color of the interruption bottom indicates the color of the bottom part.

Unlike android, ios has to additionally specify the bottom color.


android, ios

Screenshot_20211125-152235_Expo Go, IMG-1149

import React from "react";
import { StyleSheet, Text, View } from "react-native";

import { NotchView, NotchProvider } from "react-native-notchclear";
export default function App() {
  return (
    <NotchProvider>
      <NotchView edges={["top"]} top="#ff0000" bottom="#00ff00" main="#ffffff">
        <Text>12312312312321312312</Text>
      </NotchView>
    </NotchProvider>
  );
}

If you want to exclude the lower part of ios from the notch area

You can do this by adding the edges={["top"]} option.


android, ios

Screenshot_20211125-152250_Expo Go, IMG-1150

import React from "react";
import { StyleSheet, Text, View } from "react-native";

import { NotchView, NotchProvider } from "react-native-notchclear";
export default function App() {
  return (
    <NotchProvider>
      <NotchView
        edges={["bottom"]}
        top="#ff0000"
        bottom="#00ff00"
        main="#ffffff"
      >
        <Text>12312312312321312312</Text>
      </NotchView>
    </NotchProvider>
  );
}

Conversely, only top can be excluded from the notch area, and left, right, top, and bottom are all possible.


If you want to change the color of the statusbar, just add

import React from "react";
import { StyleSheet, Text, View, StatusBar } from "react-native";

import { NotchView, NotchProvider } from "react-native-notchclear";
export default function App() {
  return (
    <NotchProvider>
      <NotchView edges={["top"]} top="#ff0000" bottom="#FFFFFF" main="#00ff00">
        <StatusBar
          animated={true}
          backgroundColor="#61dafb"
          //barStyle={statusBarStyle}
          //showHideTransition={statusBarTransition}
          hidden={false}
        />
        <Text>1231231231232132</Text>
      </NotchView>
    </NotchProvider>
  );
}

Properties

All props of react-native-notchclear.

| Prop | required | Type | Description | | ------ | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | top | X | string | Enter the color in hexadecimal. ex) #ff0000 The default is #ffffff. | | main | X | string | Enter the color in hexadecimal. ex) #ff0000 The default is #ffffff. | | bottom | X | string | Enter the color in hexadecimal. ex) #ff0000 The default is #ffffff. | | edges | X | array | edges={["top"]} ,edges={["bottom"]} ,edges={["left"]} ,edges={["right"]} All four directions are possible and it is possible to use them together. ex) edges={["top"],["left"]} |