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-pushdown-alert

v0.5.2

Published

A customizable pushdown alert component for React Native applications.

Downloads

85

Readme

A customizable pushdown alert component for React Native applications. It provides a simple way to display success, error, and warning notifications with a unique pushdown animation that pushes down the entire content of app to show the notification.

demo

Features

  • Display success, error, and warning notifications.
  • Customizable alert appearance and behavior.
  • Queue or cancel current alerts based on configuration.
  • Supports custom icons and styles.

Installation

To install the library, use npm or yarn:

npm install react-native-pushdown-alert
# or
yarn add react-native-pushdown-alert

Usage

Here's a basic example of how to use the react-native-pushdown-alert in your application:


import { PushDownAlertPortal, showNotification} from 'react-native-pushdown-alert';
import { View, Button } from 'react-native';

const MyApp = () => {
  return (
    <View>
      <Button
        title="Show Notification Success"
        onPress={() => {
          showNotification({
            type: 'success',
            message: 'Hi a message body',
            title: 'Hello World',
          });
        }}
      />
    </View>
  );
};

const config = {}

const App = () => {
  return (
    <PushDownAlertPortal config={config}>
      <MyApp />
    </PushDownAlertPortal>
  );
};

Step-by-Step Guide

  1. Import the Components : Import PushDownAlertPortal and showNotification from the library.

    import { PushDownAlertPortal } from 'react-native-pushdown-alert';
  2. Place the Portal : Place the PushDownAlertPortal component as high as possible in your component tree. This ensures that alerts can be displayed over all other components.

    const App = () => {
    return (
     <PushDownAlertPortal config={config}>
       {...rest of your app}
     </PushDownAlertPortal>
    );
    };
  3. Trigger Notifications : Use the showNotification function anywhere in your app to trigger alerts. You can call this function in response to events, such as button presses or API responses.

[!NOTE]
If a notification is already showing, subsequent showNotification calls will be queued based your chosen queuing behavior.

showNotification({
  type: 'success',
  message: 'Hi a message body',
  title: 'Hello World',
});

API

showNotification

  • Parameters :
    • type : Type of the alert ( success , error , warning ).
    • title : Title of the alert.
    • message : Message body of the alert.

PushDownAlertPortal

  • Props :
    • config : Configuration object for customizing alert behavior and appearance.

Configuration

You can customize the alert behavior and appearance by passing a configuration object to the PushDownAlertPortal component. Here are some of the available options:

  • alertDisplayDuration : Duration for which the alert is displayed.
  • openAnimationDuration : Duration of the open animation.
  • closeAnimationDuration : Duration of the close animation.
  • alertQueueBehaviour : Determines how alerts are handled when a notification is already showing. Options include:
    • queue : New alerts are added to a queue and displayed sequentially.
    • cancelCurrent : The current alert is dismissed, and the new alert is displayed immediately.
  • titleTextStyle : Custom style for the alert title.
  • messageTextStyle : Custom style for the alert message.
  • successConfig , errorConfig , warningConfig : Custom configurations for each alert type, including icons and background colors.

Sample Configuration

Here's an example of how you can customize the alert configurations:

const config = {
  alertDisplayDuration: 4000,
  openAnimationDuration: 500,
  closeAnimationDuration: 500,
  alertQueueBehaviour: 'queue',
  titleTextStyle: { fontSize: 18, fontWeight: 'bold', color: '#fff' },
  messageTextStyle: { fontSize: 16, color: '#fff' },
  successConfig: {
    icon: <CustomSuccessIcon />, // Replace with your custom icon component
    backgroundColor: '#4CAF50', // Green background for success alerts
  },
  errorConfig: {
    icon: <CustomErrorIcon />, // Replace with your custom icon component
    backgroundColor: '#F44336', // Red background for error alerts
  },
  warningConfig: {
    icon: <CustomWarningIcon />, // Replace with your custom icon component
    backgroundColor: '#FFC107', // Yellow background for warning alerts
  },
};

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT