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

@sahil5261/nudge-ui

v1.0.1

Published

Interactive CLI for Nudge UI - Scaffold, configure, and eject toast notifications in React, Next.js, and Vanilla JS

Downloads

179

Readme

🔔 Nudge UI CLI (nudge-ui)

The ultimate interactive CLI & notification engine for modern web apps.
Scaffold, configure, customize, and eject production-grade toast notifications in seconds.

npm version Live Playground TypeScript License: MIT Frameworks

npx nudge-ui

👨‍💻 Creator & Maintainer


🌐 Live Interactive Playground

Explore, test, and customize toast notifications in real-time on the Nudge UI web playground:

👉 Launch Nudge UI Playground (https://nudgeui.vercel.app/)

  • 🎨 Multi-Style Preview: Switch between Default, Minimal, Glassmorphism, Bordered, and Accent themes.
  • 🌗 Theme Transitions: Test Light & Dark modes with live CSS/Tailwind code generation.
  • 📋 One-Click Code Export: Copy production-ready React and Tailwind code directly to your clipboard.

⚡ Highlights

  • 🚀 Zero Hassle Setup — Scaffold full toast notification infrastructure with a single interactive terminal command.
  • 🎨 Dual Style Modes — Seamless support for both Tailwind CSS and Vanilla CSS (BEM).
  • 📦 Zero External UI Dependencies — Self-contained SVG icons and clean observer engine.
  • 🧩 100% Code Ownership (eject) — Eject complete source files directly into your codebase. No lock-in!
  • 🌐 Framework Agnostic — Native support for Next.js (App Router/Pages), React Vite, CRA, and Vanilla JS.
  • 🎯 Fully Typed — Written with strict TypeScript definitions for all options, types, and callbacks.

🚀 Quick Start

Run the interactive scaffolding wizard directly with npx without installing anything:

npx nudge-ui

or explicitly run the init command:

npx nudge-ui init

📦 Global Installation (Optional)

If you prefer having the CLI globally available across all your projects:

npm install -g nudge-ui

Then invoke anywhere:

nudge init

🛠️ CLI Commands & Flags

| Command | Description | Example | |---|---|---| | npx nudge-ui | Launch interactive setup wizard | npx nudge-ui | | npx nudge-ui init | Initialize Nudge UI in current project | npx nudge-ui init --style tailwind | | npx nudge-ui eject | Eject source code directly into project | npx nudge-ui eject | | npx nudge-ui list | View available components & presets | npx nudge-ui list | | npx nudge-ui add | Add specific components on demand | npx nudge-ui add ToastContainer |

Available init Flags:

npx nudge-ui init [options]

Options:
  -y, --yes          Skip prompts and use smart defaults
  -s, --style <type> Choose "tailwind" or "css" (default: auto-detected)
  -t, --typescript   Generate TypeScript (.ts/.tsx) templates
  -d, --dir <path>   Custom directory for components (default: components/toaster)
  -h, --help         Display help for command

💻 How to Use in Your Application

1. Add ToastContainer to your root layout / App:

// app/layout.tsx (Next.js App Router) or App.tsx (React Vite)
import { ToastContainer } from "@/components/toaster/ToastContainer";
// If using CSS mode:
// import "./toaster.css";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        {/* Renders the toast portal */}
        <ToastContainer />
      </body>
    </html>
  );
}

2. Trigger Toasts from anywhere:

import { toast } from "@/lib/toaster-core";

// Success Toast
toast.success("Profile updated successfully!");

// Error Toast
toast.error("Failed to save changes. Please try again.");

// Warning Toast
toast.warning("Your session will expire in 5 minutes.");

// Info Toast
toast.info("A new version is available for download.");

// Loading Async / Promise Toast
const toastId = toast.loading("Uploading documents...");
try {
  await uploadFiles();
  toast.update(toastId, {
    type: "success",
    message: "Documents uploaded successfully!",
    autoClose: true,
    duration: 3000,
  });
} catch (err) {
  toast.update(toastId, {
    type: "error",
    message: "Upload failed.",
    autoClose: true,
    duration: 4000,
  });
}

⚙️ Toast Configuration Options

toast.show("Custom Notification", {
  type: "success",          // "default" | "success" | "error" | "warning" | "info" | "loading" | "custom"
  position: "bottom-right", // "top-right" | "top-left" | "top-center" | "bottom-right" | "bottom-left" | "bottom-center"
  duration: 4000,           // Duration in milliseconds (default: 4000)
  autoClose: true,          // Automatically dismiss after duration
  title: "Optional Title",  // Bold title above the message
  allowHtml: false,         // Render HTML content (sanitize first!)
  twClass: "border-2",      // Custom Tailwind utility classes
  className: "custom-toast",// Custom CSS class
  onClose: (t) => {         // Callback fired on dismiss
    console.log("Toast closed:", t.id);
  },
});

📤 How to Publish to NPM

Follow these 4 simple steps to publish your CLI package to npm:

# 1. Navigate to the CLI directory
cd nudge-cli # (or your CLI directory)

# 2. Log in to your npm account
npm login

# 3. Test pack dry-run
npm pack --dry-run

# 4. Publish to npm registry
npm publish --access public

🤝 Connect & Collaborate

Have questions, feedback, or ideas?


📄 License

MIT © Sahil Gadhiya