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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-irano

v1.1.1

Published

A customizable cross-platform toast notification library for React Native.

Readme

React Native Irano

Video Demonstration

You can watch a demonstration of the React Native Irano components in action below:

Installation

To use the React Native Irano components, ensure you have the following dependencies installed in your React Native project. You can use one of the following commands based on your package manager:

npm install react-native-irano
# or
yarn add react-native-irano

Table of Contents

Overview

React Native Irano is a library that provides customizable alert and toast components for React Native applications. It allows developers to easily display notifications and alerts with smooth animations and various presets.

Usage Example

To use the IranoProvider, Alert, and Toast components in your application, follow the example below:

Step 1: Wrap Your Application with IranoProvider

First, ensure that your application is wrapped with the IranoProvider to provide context for the alert and toast functionalities.

import React from 'react';
import { IranoProvider } from 'react-native-irano';
import Home from './Home';

const App = () => {
    return (
        <IranoProvider
            doneProps={{
                titleStyle: { color: 'green' },
                subtitleStyle: { color: 'lightgray' },
            }}
            loadingProps={{
                titleStyle: { color: 'blue' },
                subtitleStyle: { color: 'lightgray' },
            }}
            errorProps={{
                titleStyle: { color: 'red' },
                subtitleStyle: { color: 'lightgray' },
            }}
        >
            <Home />
        </IranoProvider>
    );
};

export default App;

Step 2: Use the useIrano Hook in Your Component

In your component (e.g., Home), you can use the useIrano hook to access the showAlert and onToast functions.

import React from 'react';
import { View, Button } from 'react-native';
import { useIrano } from 'react-native-irano';

const Home = () => {
    const { showAlert, onToast } = useIrano();

    const handleShowAlert = () => {
        showAlert({
            title: 'Success!',
            subtitle: 'Your operation was successful.',
            preset: 'done',
        });
    };

    const handleShowToast = () => {
        onToast({
            title: 'Toast Notification',
            subtitle: 'This is a toast message.',
            preset: 'success',
        });
    };

    return (
        <View>
            <Button title="Show Alert" onPress={handleShowAlert} />
            <Button title="Show Toast" onPress={handleShowToast} />
        </View>
    );
};

export default Home;

Components

Alert Component

The Alert component is a customizable modal alert dialog for React Native applications. It provides visual feedback to users through various presets such as "done", "loading", and "error".

Props

| Prop | Type | Description | | ----------------------- | -------------------------- | -------------------------------------------------------------------- | | title | string | The title of the alert dialog. | | subtitle | string | The subtitle of the alert dialog. | | onClose | () => void | Callback function to be called when the alert is closed. | | visible | boolean | Controls the visibility of the alert dialog. | | preset | 'done' | 'loading' | 'error' | Determines the type of alert to display. | | titleStyle | TextStyle | Custom styles for the title text. | | subtitleStyle | TextStyle | Custom styles for the subtitle text. | | animatedViewProps | AnimatedProps<ViewProps> | Additional props for the animated view. | | overlayStyle | ViewStyle | Custom styles for the modal overlay. | | autoHide | boolean | If true, the alert will automatically close after a specified delay. | | autoHideDelay | number | The delay in milliseconds before the alert automatically closes. | | delay | number | The delay in milliseconds before the animation starts. | | duration | number | The duration of the animation in milliseconds. |

Toast Component

The Toast component is a lightweight notification that appears temporarily at the top or bottom of the screen. It provides feedback to users about an operation.

Props

| Prop | Type | Description | | ----------------------- | -------------------------- | -------------------------------------------------------------------- | | title | string | The title of the toast notification. | | subtitle | string | The subtitle of the toast notification. | | onHide | () => void | Callback function to be called when the toast is hidden. | | preset | 'success' | 'error' | Determines the type of toast to display. | | position | 'top' | 'bottom' | Position of the toast on the screen. | | MAX_WIDTH | number | Maximum width of the toast. | | autoHideDuration | number | Duration in milliseconds before the toast automatically hides. | | iconContainerStyle | ViewStyle | Custom styles for the icon container. | | toastMainContainerStyle| ViewStyle | Custom styles for the main toast container. | | textContainerStyle | ViewStyle | Custom styles for the text container. | | titleStyle | TextStyle | Custom styles for the title text. | | subtitleStyle | TextStyle | Custom styles for the subtitle text. | | pathProps | PathProps | Additional props for the animated SVG path. |

Features

  • Customizable alert and toast presets (done, loading, error).
  • Smooth animations using react-native-reanimated.
  • Easy integration with React Native applications.

Styles

The components use default styles defined in their respective style objects. You can customize the appearance by passing your own styles through the relevant style props.

Animations

The Alert and Toast components utilize the react-native-reanimated library for smooth animations. The alert can animate in and out using various effects.

Example Presets

  • Done: Displays a checkmark to indicate success.
  • Loading: Shows a loading spinner.
  • Error: Displays an "X" icon to indicate an error.

Contributing

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

License

This component is open-source and available under the MIT License. Feel free to use and modify it in your projects.

Getting Help

If you encounter any issues or have questions, please open an issue in the repository or contact the maintainers for support.

Made with create-react-native-library