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

dropul

v0.0.11

Published

A hover-triggered popout dropdown component for React.

Readme

Dropul

A lightweight, hover-triggered inline dropdown component for React. Display text, images, profiles, commit grids, or real GitHub contribution data on hover — with smooth CSS animations and dark mode support.

Installation

npm install dropul

No additional dependencies required! Dropul uses pure CSS animations.

Setup

Option 1: Import the CSS (Recommended)

Simply import the included stylesheet in your app's entry point:

// In your _app.tsx, layout.tsx, or main entry file
import 'dropul/styles.css';

That's it! All styles are included.

Option 2: Tailwind CSS Configuration

If you prefer to use Tailwind and want to customize styles, add the package to your Tailwind config:

// tailwind.config.js or tailwind.config.ts
module.exports = {
  content: [
    // ... your other content paths
    './node_modules/dropul/**/*.{js,mjs}',
  ],
  // ...
}

Dark Mode

Dropul fully supports Tailwind's dark mode. Just ensure your Tailwind config has dark mode enabled:

// tailwind.config.js
module.exports = {
  darkMode: 'class', // or 'media'
  // ...
}

The component will automatically adapt to light/dark themes.

Usage

Import and use anywhere in your app:

import { Dropout } from 'dropul';

function App() {
  return (
    <p>
      Check out <Dropout variant="text" trigger="this feature" text="A simple tooltip!" /> in action.
    </p>
  );
}

Variants

Text

<Dropout 
  variant="text" 
  trigger="hover me" 
  text="This is a tooltip message." 
/>

Image

<Dropout 
  variant="image" 
  trigger="preview" 
  imageSrc="/path/to/image.jpg" 
  imageAlt="Description" 
  size="default" // or "sm" for smaller images
/>

Image + Text

<Dropout 
  variant="image-text" 
  trigger="Jane Doe" 
  imageSrc="/avatar.jpg" 
  title="Jane Doe" 
  subtitle="Software Engineer" 
/>

GitHub Contributions

Display real GitHub contribution data for any user:

<Dropout 
  variant="github-contributions" 
  trigger="my commits" 
  username="octocat"
  apiEndpoint="/api/github-contributions" // See below
/>

API Route Setup (Required for CORS)

Due to browser CORS restrictions, you need to create a server-side API route to fetch GitHub data.

Option 1: One-line export (Recommended)

// app/api/github-contributions/route.ts
export { GET } from 'dropul/github';

That's it! The package includes a pre-built handler.

Option 2: Custom handler with helper function

// app/api/github-contributions/route.ts
import { fetchGitHubContributions } from 'dropul/github';
import { NextRequest, NextResponse } from 'next/server';

export async function GET(request: NextRequest) {
  const username = request.nextUrl.searchParams.get('username');
  if (!username) {
    return NextResponse.json({ error: 'Username required' }, { status: 400 });
  }
  
  const contributions = await fetchGitHubContributions(username, 12);
  return NextResponse.json(contributions);
}

Commit Grid (Custom Data)

Display a custom commit-style grid with your own data:

<Dropout 
  variant="commit-grid" 
  trigger="activity" 
  data={[0, 1, 2, 3, 4, 2, 1, 0, 3, 4, 2, 1, 0, 1]} // values 0-4
  columns={7}
/>

Props

| Prop | Type | Description | |------|------|-------------| | trigger | ReactNode | The content that triggers the dropdown on hover | | variant | 'text' \| 'image' \| 'image-text' \| 'commit-grid' \| 'github-contributions' | The type of content to display | | href | string? | Optional link URL - makes trigger an anchor tag | | triggerClassName | string? | Custom classes for the trigger element | | ariaLabel | string? | Accessibility label (default: "Dropdown") |

Variant-specific props

text

  • text (string) — The tooltip text to display

image

  • imageSrc (string) — Image URL
  • imageAlt (string?) — Alt text for the image
  • size ('sm' | 'default'?) — Image size (default: 'default')

image-text

  • imageSrc (string) — Image URL
  • title (string) — Title text
  • subtitle (string?) — Subtitle text
  • imageAlt (string?) — Alt text for the image

commit-grid

  • data (number[]) — Array of values 0-4 representing intensity
  • columns (number?) — Grid columns (default: 7)

github-contributions

  • username (string) — GitHub username
  • apiEndpoint (string?) — API route URL for fetching contributions

Features

  • 🎨 Dark mode support — Automatically adapts to light/dark themes
  • Zero animation dependencies — Uses pure CSS animations with spring effect
  • 📱 Mobile friendly — Works with touch events
  • Accessible — Keyboard navigation and ARIA attributes
  • 🖼️ Image preloading — Images are preloaded on hover for instant display
  • 🎯 Lightweight — No Framer Motion or other animation libraries required

Requirements

  • React 18+ or 19
  • Tailwind CSS (with dropul added to content config)

License

MIT