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

catnips-dialog

v1.0.2

Published

A React dialog/modal component library with Catnip design system

Readme

Catnips Dialog

A React dialog/modal component library with Catnip design system.

Installation

# Using bun
bun add catnips-dialog

# Using npm
npm install catnips-dialog

# Using yarn
yarn add catnips-dialog

# Using pnpm
pnpm add catnips-dialog

Usage

Import and use the Dialog component

Styles are automatically injected when the Dialog component is rendered - no manual CSS import needed!

import { Dialog } from "catnips-dialog";

function App() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <>
      <button onClick={() => setIsOpen(true)}>Open Dialog</button>

      <Dialog
        open={isOpen}
        onClose={() => setIsOpen(false)}
        title="Dialog Title"
        description="Dialog description text"
        actions={[
          { label: "Cancel", onClick: () => setIsOpen(false), variant: "outline" },
          { label: "Confirm", onClick: handleConfirm, variant: "secondary" },
        ]}
      />
    </>
  );
}

API

DialogProps

| Prop | Type | Default | Description | |------|------|---------|-------------| | open | boolean | - | Whether the dialog is visible | | onClose | () => void | - | Callback when dialog should close | | title | string | - | Dialog title | | description | ReactNode | - | Description text or custom content | | actions | DialogAction[] | [] | Action buttons | | children | ReactNode | - | Scrollable body content | | closeOnOverlayClick | boolean | true | Close when clicking outside | | closeOnEscape | boolean | true | Close when pressing ESC | | className | string | - | Additional CSS class for the dialog container |

DialogAction

| Prop | Type | Default | Description | |------|------|---------|-------------| | label | string | - | Button text | | onClick | () => void | - | Click handler | | variant | "primary" \| "secondary" \| "outline" | "primary" | Button style |

Button Variants

| Variant | Description | |---------|-------------| | primary | Green background (#7afba3) - for single button dialogs | | secondary | White background (#f2f2f2) - for primary action in 2-button dialogs | | outline | Transparent with white border - for secondary action |

Customization

The dialog uses CSS variables that you can override to customize the appearance:

:root {
  --cn-dialog-bg: #2c373a;
  --cn-dialog-bg-dark: #152124;
  --cn-dialog-text-primary: #f2f2f2;
  --cn-dialog-text-secondary: #a1a6a7;
  --cn-dialog-overlay-bg: rgba(0, 0, 0, 0.5);
  --cn-dialog-border-radius: 24px;
  --cn-dialog-btn-radius: 100px;
  --cn-dialog-btn-primary-bg: #7afba3;
  --cn-dialog-btn-primary-text: #152124;
  --cn-dialog-btn-secondary-bg: #f2f2f2;
  --cn-dialog-btn-secondary-text: #152124;
  --cn-dialog-btn-outline-border: #f2f2f2;
  --cn-dialog-btn-outline-text: #f2f2f2;
  --cn-dialog-z-index: 9999;
}

You can also use the className prop to add custom classes for more specific styling.

Examples

Basic Dialog (1 action)

<Dialog
  open={isOpen}
  onClose={() => setIsOpen(false)}
  title="Success"
  description="Operation completed successfully."
  actions={[{ label: "OK", onClick: () => setIsOpen(false) }]}
/>

Confirmation Dialog (2 actions)

<Dialog
  open={isOpen}
  onClose={() => setIsOpen(false)}
  title="Delete Item"
  description="Are you sure you want to delete this item?"
  actions={[
    { label: "Cancel", onClick: () => setIsOpen(false), variant: "outline" },
    { label: "Delete", onClick: handleDelete, variant: "secondary" },
  ]}
/>

Scrollable Dialog with Custom Content

<Dialog
  open={isOpen}
  onClose={() => setIsOpen(false)}
  title="Preview"
  description="Select an option below"
  actions={[
    { label: "Cancel", onClick: () => setIsOpen(false), variant: "outline" },
    { label: "Confirm", onClick: handleConfirm, variant: "secondary" },
  ]}
>
  {/* Custom scrollable content */}
  <img src="/preview.png" alt="Preview" />
  <p>Additional information here</p>
</Dialog>

Blocking Dialog (Loading State)

<Dialog
  open={isLoading}
  onClose={() => {}}
  title="Processing"
  description="Please wait..."
  closeOnOverlayClick={false}
  closeOnEscape={false}
>
  <LoadingSpinner />
</Dialog>

Development

# Install dependencies
bun install

# Run development server
bun run dev

# Type check
bun run typecheck
  • Demo page: http://localhost:3000
  • Example page: http://localhost:3000/example

License

MIT