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

rn-themed-alert

v0.2.0

Published

A themeable, animated, promise-based alert/confirm/prompt modal for React Native, plus toast notifications and a loading/progress overlay — a cross-platform replacement for Alert.alert / Alert.prompt.

Readme

rn-themed-alert

A themeable, animated, promise-based alert / confirm / prompt for React Native — one component to replace Alert.alert, Alert.prompt (iOS-only), and every one-off custom modal you've hand-rolled.

  • 🎨 Fully themeable — colors, radius, font, dark mode included
  • Promise-basedawait confirm(...) instead of callback hell
  • 🧵 Queued — calling alert/confirm/prompt back-to-back shows them one at a time in order, never stacked
  • ✍️ Prompt with validation — inline error text, no separate modal needed
  • 🎬 Animated — spring scale-in, fade, tap feedback on buttons
  • 🌗 5 variants — default, success, error, warning, info
  • 📱 Cross-platform — same API and look on iOS and Android (unlike Alert.prompt, which is iOS-only)

Install

npm install rn-themed-alert

No extra native dependencies — built on Modal, Animated, and TextInput from react-native core.

Setup

Wrap your app once, near the root:

import { ThemedAlertProvider } from 'rn-themed-alert';

export default function App() {
  return (
    <ThemedAlertProvider>
      <YourApp />
    </ThemedAlertProvider>
  );
}

Usage

import { useAlert } from 'rn-themed-alert';

function SettingsScreen() {
  const { alert, confirm, prompt } = useAlert();

  const onDelete = async () => {
    const ok = await confirm({
      title: 'Delete account?',
      message: 'This cannot be undone.',
      variant: 'error',
      confirmText: 'Delete',
      destructive: true,
    });
    if (!ok) return;

    // ... delete ...
    await alert({ title: 'Account deleted', variant: 'success' });
  };

  const onRename = async () => {
    const name = await prompt({
      title: 'Rename chat',
      placeholder: 'Chat name',
      defaultValue: 'Weekend trip',
      validate: (v) => (v.trim().length === 0 ? 'Name cannot be empty' : null),
    });
    if (name === null) return; // cancelled
    // ... save `name` ...
  };

  return (/* buttons calling onDelete / onRename */);
}

Theming

Pass a partial theme override to the provider — only override what you need, the rest falls back to sensible defaults:

import { ThemedAlertProvider, defaultDarkTheme } from 'rn-themed-alert';

<ThemedAlertProvider theme={{ primaryButtonBg: '#7C5CFF', borderRadius: 28 }}>
  <YourApp />
</ThemedAlertProvider>

// or go full dark mode:
<ThemedAlertProvider theme={defaultDarkTheme}>
  <YourApp />
</ThemedAlertProvider>

Tie it to your app's own theme context by passing your current theme's colors into theme={{ ... }} wherever you already read them (e.g. in your root layout, alongside your existing useTheme()).

API

<ThemedAlertProvider theme?={Partial<AlertTheme>}>

Mount once near your app root. Renders the modal portal.

useAlert()

Returns { alert, confirm, prompt }.

alert(options): Promise<void>

| Option | Type | Default | |---|---|---| | title | string | required | | message | string | — | | variant | 'default' \| 'success' \| 'error' \| 'warning' \| 'info' | 'default' | | buttonText | string | 'OK' | | dismissOnBackdropPress | boolean | true |

confirm(options): Promise<boolean>

Same base options, plus: | confirmText | string | 'Confirm' | | cancelText | string | 'Cancel' | | destructive | boolean | false — styles confirm button red |

Resolves true if confirmed, false if cancelled or backdrop-dismissed.

prompt(options): Promise<string | null>

Same base options, plus: | placeholder | string | — | | defaultValue | string | '' | | secureTextEntry | boolean | false | | keyboardType | 'default' \| 'email-address' \| 'numeric' \| 'phone-pad' | 'default' | | validate | (value: string) => string \| null \| undefined | — return an error string to block confirm |

Resolves the entered string, or null if cancelled.

License

MIT