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

alert-v

v1.0.6

Published

react native alert with ts support

Downloads

17

Readme

Alert-V

Alert-V is a versatile and customizable React Native component designed to display alerts with TypeScript support. It is a cross-platform solution that provides a seamless user experience for both iOS and Android applications. With Alert-V, you can create alerts with various styles and functionalities tailored to your app's needs.

Features

  • Customizable Alerts: Easily customize the title, subtitle, and button texts to match your app's design and requirements.
  • Single or Double Button Options: Choose between showing a single cancel button or both cancel and confirm buttons.
  • Backdrop Press Handling: Configure whether the alert should close when the user presses outside the modal.
  • Styling Flexibility: Apply custom styles to various components of the alert, such as the modal, container, text wrapper, title, subtitle, and buttons.

Usage

Alert-V is straightforward to integrate into your React Native project. By utilizing the provided props and methods, you can display alerts dynamically based on user actions or app events.

Here is a simple code below, for its usage.

import {AlertProvider, AlertV} from "alert-v"

const App = () => {

    const handleAlertPress = () => {
        AlertV.show({
            title: "My custom title", // required
            titleStyle: {color: "white"}, // optional
            subTitle: "You can add here detailed explanation of something", // optional
            subTitleStyle: {color: "white"}, // optional
            confirmOnPress: () => console.log("Confirmed"),
            cancelOnPress: () => console.log("Cancelled"), // required
            cancelButtonTitle: "Cancel", // optional
            confirmButtonTitle: "Agree", // optional
            cancelStyle: {color: "red"}, // optional
            confirmStyle: {color: "green"}, // optional
            backdropPress: false, // outside click doesn't close the modal
            singleButton: false, // shows only one button ( cancelOnPress )
            containerStyle: {backgroundColor: "grey"},
            modalTransparencyStyle: {backgroundColor: "red"},
            textWrapperStyle: {backgroundColor: "red"}, // title and subtitle view container styles
        })
    }

    return (
        <AlertProvider>
            <Button title="Open Alert" onPress={handleAlertPress} />
            {/* ... your other components here */}
        </AlertProvider>
    )
}

export default App

NOTE!

You should wrap your main file (App.js/ts) with AlertProvider and use the AlertV object and call its show method wherever you want in your project.

Props

| Prop | Type | Default | Note | |----------------------|-----------|------------|------------------------------------------| | title | string | (Required) | Title for alert. | | subTitle | string | | Sub title for alert. | | cancelButtonTitle | string | | Cancel button text | | confirmButtonTitle | string | | Confirm button text | | singleButton | boolean | false | For only cancel button show. | | backdropPress | boolean | false | closing modal when pressing the outside. |

Styles

| Prop | Type | Note | |--------------------------|-------------|--------------------------------------| | modalTransparencyStyle | ViewStyle | Give style to your modal | | containerStyle | ViewStyle | Main container styles | | textWrapperStyle | ViewStyle | Title and subtitle container style | | subTitleStyle | TextStyle | Sub title text style | | cancelStyle | TextStyle | Cancel button text style | | confirmStyle | TextStyle | Confirm button text style | | titleStyle | TextStyle | Title text style |

Methods

| Method Name | Arguments | Default | Note | |------------------|------------|--------------|--------------------------------------| | cancelOnPress | callback | (Required) | Callback for cancel button press. | | confirmOnPress | callback | | Callback for confirm button press. |

Gif example

example image