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 🙏

© 2025 – Pkg Stats / Ryan Hefner

whatsnew-embed

v1.0.2

Published

Reusable React component to embed 'What's New' updates via API

Readme

📢 whatsnew-embed

Easily manage and showcase "What's New" updates in your application.
whatsnew-embed lets you display release notes, feature announcements, and updates beautifully, with ready-to-use components for featured embeds and update cards.


✨ Features

  • 🎨 Prebuilt, responsive UI components for update listings
  • ⚡ Easy integration into any React app
  • 🛠 Customizable styles via classes prop
  • 🔄 Supports dynamic fetching from your backend
  • 📅 Automatically sorts updates by date
  • 🖱 Clickable cards to view detailed updates

📦 Installation

npm install whatsnew-embed




Usage Example 


import { useEffect, useState, useMemo } from "react"
import { Sparkles } from "lucide-react"
import { WhatsNewCard, WhatsNewEmbed } from "whatsnew-embed"
import type { WhatsNewItem } from "../types"

const API_URL = (username: string) => `http://localhost:8000/api/v1/public/whatsnew/${username}`

export default function WhatsNewApp() {
  const [entries, setEntries] = useState<WhatsNewItem[]>([])
  const [selected, setSelected] = useState<WhatsNewItem | null>(null)

  useEffect(() => {
    fetch(API_URL(username))
      .then((res) => res.json())
      .then((data) => {
        const sorted = data.message.entries
          .sort((a: any, b: any) => new Date(b.date).getTime() - new Date(a.date).getTime())
          .map((entry: any) => ({ ...entry, id: entry._id }))
        setEntries(sorted)
      })
      .catch((err) => {
        console.error("Failed to fetch What's New entries:", err)
      })
  }, [username])

  const featured = selected ?? entries[0]
  const others = useMemo(() => entries.filter((e) => e.id !== featured?.id), [entries, featured])

  return (
    <div className="max-w-6xl mx-auto py-12 px-4">
      {/* Header */}
      <div className="text-center mb-12">
        <div className="flex justify-center items-center gap-2 text-blue-600">
          <Sparkles className="h-6 w-6" />
          <h1 className="text-4xl font-bold">What's New</h1>
        </div>
        <p className="text-muted-foreground mt-2">Explore the latest updates and features.</p>
      </div>

      {/* Featured Update */}
      {featured && (
        <div className="mb-12">
          <WhatsNewEmbed
            key={featured.id}
            update={featured}
            showBackButton={!!selected}
            onBack={() => setSelected(null)}
            classes={{
              wrapper: "bg-gradient-to-br from-white to-gray-100 shadow-2xl p-10",
              content: "prose prose-indigo",
            }}
          />
        </div>
      )}

      {/* Other Updates */}
      {others.length > 0 && (
        <div className="grid grid-cols-1 md:grid-cols-2 gap-6">
          {others.map((entry) => (
            <WhatsNewCard key={entry.id} update={entry} onClick={() => setSelected(entry)} />
          ))}
        </div>
      )}
    </div>
  )
}





WhatsNewEmbed Props


| Prop             | Type                                     | Description                          |
| ---------------- | ---------------------------------------- | ------------------------------------ |
| `update`         | `WhatsNewItem`                           | Update object to display             |
| `showBackButton` | `boolean`                                | Whether to show a back button        |
| `onBack`         | `() => void`                             | Callback when back button is clicked |
| `classes`        | `{ wrapper?: string; content?: string }` | Custom CSS classes                   |


WhatsNewCard Props


| Prop      | Type           | Description                        |
| --------- | -------------- | ---------------------------------- |
| `update`  | `WhatsNewItem` | Update object for card view        |
| `onClick` | `() => void`   | Click handler for selecting update |


🎯 Customization
You can fully style the embed and cards using Tailwind CSS (or your own CSS classes) via the classes prop.