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

@blazejkustra/react-native-alert

v1.1.0

Published

Universal alerts for react native

Readme

@blazejkustra/react-native-alert

NPM Downloads

Universal, customizable alerts and prompts for React Native — identical API to the built-in Alert, but works seamlessly across iOS, Android, and Web.

React Native Alert

🚀 Features

  • Cross-platform – iOS, Android, Web with one API
  • Drop-in replacement – same API as Alert
  • Prompts everywhere – text input prompts supported on all platforms
  • Modern Web implementation – built with <dialog> + CSS custom properties
  • Dark/light themes – automatic with manual override
  • Accessible – full keyboard navigation + screen reader support
  • TypeScript ready – complete type definitions

📦 Installation

npm install @blazejkustra/react-native-alert

No extra setup needed on iOS or Android (just rebuild your app). On Web, styles are injected automatically and can be customized with CSS variables.

🛠 Usage

Basic Alert

import Alert from '@blazejkustra/react-native-alert';

Alert.alert('Hello!', 'This is a cross-platform alert.');

Alert with Buttons

Alert.alert(
  'Confirm',
  'Do you want to continue?',
  [
    { text: 'Cancel', style: 'cancel' },
    { text: 'OK', style: 'default' },
  ]
);

Destructive Alert

Alert.alert(
  'Delete item?',
  'This action cannot be undone.',
  [
    { text: 'Cancel', style: 'cancel' },
    { text: 'Delete', style: 'destructive' },
  ]
);

Prompt

Alert.prompt(
  'Enter your name',
  'Please type your name below:',
  [
    { text: 'Cancel', style: 'cancel' },
    { text: 'OK', onPress: (value) => console.log('Name:', value) },
  ],
  'plain-text',
  'John Doe'
);

Secure Prompt

Alert.prompt(
  'Password',
  'Enter your password:',
  [
    { text: 'Cancel', style: 'cancel' },
    { text: 'OK', onPress: () => console.log('Password entered') },
  ],
  'secure-text'
);

For more examples, see example/src/App.tsx.

📖 API

Same as React Native Alert.

📱 Platform Notes

  • iOS – uses React Native's built-in Alert.alert and Alert.prompt
  • Android – uses React Native's built-in Alert.alert and custom native module with Material styling for Alert.prompt
  • Web – HTML5 <dialog>, themeable via CSS variables

🎨 Web Customization

Override CSS variables to match your design system:

:root {
  --rn-alert-accent: #059669;   /* Primary button */
  --rn-alert-danger: #dc2626;   /* Destructive button */
  --rn-alert-bg: #fefefe;       /* Dialog background */
  --rn-alert-fg: #111827;       /* Text color */
  --rn-alert-radius: 16px;        /* Border radius */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    ...
  }
}

Available variables:

  • --rn-alert-bg – dialog background
  • --rn-alert-fg – primary text color
  • --rn-alert-muted – secondary / muted text
  • --rn-alert-surface – input & surface background
  • --rn-alert-border – border color
  • --rn-alert-elev – box shadow / elevation
  • --rn-alert-accent – primary button color
  • --rn-alert-accent-hover – primary button hover color
  • --rn-alert-danger – destructive button color
  • --rn-alert-danger-hover – destructive button hover color
  • --rn-alert-radius – border radius (dialogs/buttons)
  • --rn-alert-radius-sm – small border radius (inputs/buttons)
  • --rn-alert-spacing – default padding
  • --rn-alert-spacing-sm – small padding
  • --rn-alert-btn-min – minimum button height (touch target)
  • --rn-alert-outline – focus outline style
  • --rn-alert-outline-weak – subtle focus outline
  • --rn-alert-font – font family
  • --rn-alert-font-size – base font size
  • --rn-alert-title-size – title font size

🤝 Contributing

We welcome contributions! See CONTRIBUTING.md for workflow and CODE_OF_CONDUCT.md.

📄 License

MIT © Blazej Kustra


Built with create-react-native-library 🛠