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

pdf-carousel

v1.0.15

Published

Docsend/Forbes-style PDF slider carousel for Next.js

Readme

pdf-carousel

Docsend/Forbes-style PDF slider carousel for Next.js.

Install

npm i pdf-carousel

Usage (Next.js Pages or App Router)

The component is "use client" — import it from a client page or wrapper.

App Router (app/):

"use client";

import { PDFCarousel } from "pdf-carousel";

Pages Router (pages/):

import dynamic from "next/dynamic";

const PDFCarousel = dynamic(() => import("pdf-carousel").then((m) => m.PDFCarousel), {
  ssr: false,
});

export default function Page() {
  return (
    <PDFCarousel
      src="https://your-s3-bucket.com/media-kits/forbes-media-kit.pdf"
      logoSrc="/logo.png"
      copyrightText="© 2026 Forbes Media"
      backgroundColor="#0b0b0b"
      headerBackground="#111827"
      headerTextColor="#ffffff"
      footerBackground="#111827"
      footerTextColor="#ffffff"
      initialPage={1}
      zoomStep={0.25}
      recentIssues={[
        { label: "Jan 2026", href: "https://example.com/jan-2026" },
        { label: "Dec 2025", href: "https://example.com/dec-2025" },
      ]}
    />
  );
}

Props

PDFCarousel props:

  • src (string, required): Absolute URL to the PDF (S3, CDN, etc.)
  • initialPage (number, optional, default: 1): Starting page number (1-based)
  • zoomStep (number, optional, default: 0.25): Increment for zoom-in
  • logoSrc (string, optional): Header logo image URL
  • logoAlt (string, optional, default: "Logo"): Header logo alt text
  • copyrightText (string, optional): Footer copyright text
  • recentIssues (array, optional): Header links to other publications. Each item: { label: string; href: string }. Links open in a new tab.
  • backgroundColor (string, optional, default: "#0b0b0b"): Viewer background
  • headerBackground (string, optional, default: "#111827"): Header background color
  • headerTextColor (string, optional, default: "#ffffff"): Header text color
  • footerBackground (string, optional, default: "#111827"): Footer background color
  • footerTextColor (string, optional, default: "#ffffff"): Footer text color
  • pdfWorkerSrc (string, optional): Override pdf.js worker URL
  • className / style (optional): Wrapper styles

Controls

The viewer includes:

  • Previous/Next page buttons
  • Jump-to-page input
  • Download, Print, Zoom In, Fullscreen
  • Copy Link button

Share behavior

When you click Copy Link, the component copies the current page URL (window.location.href) as an absolute URL so it can be pasted directly into a browser.

Loading behavior

The viewer opens as soon as the first page is ready (instead of waiting for every page). Remaining pages render in order in the background, then thumbnails load after all page images are ready. If you navigate to a page that is not ready yet, a per-page loading state is shown.

Notes

Works with Next.js Pages Router and App Router. PDF.js is bundled inside the package (no react-pdf / next/navigation dependencies).

Pages Router troubleshooting

Use dynamic(..., { ssr: false }) as shown above. If you still see PDF.js/webpack errors, add to next.config.js:

/** @type {import('next').NextConfig} */
const nextConfig = {
  transpilePackages: ['pdf-carousel'],
};

module.exports = nextConfig;