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

@yeonpm/docs-template

v0.4.4

Published

A reusable document-style layout & card component library for React

Readme

@yeonpm/docs-template

A reusable document-style layout and card component library for React.

Provides a full-featured Shell (header + side navigation + main content area), a versatile CommonCard, a slide-in Drawer panel, a multi-format Citation Modal, and a ready-to-use DocsGuide page — everything you need to build portfolio / CV / documentation sites quickly.

Installation

npm install @yeonpm/docs-template

Peer Dependencies

The following packages must be installed in your project:

npm install @yeonpm/react @emotion/react @emotion/styled react-icons zustand

Components

| Component | Description | |---|---| | CommonizeShell | Top-level layout combining Header + SideNav + main content area | | CommonizeHeader | Fixed top header with brand title, right slot, and mobile hamburger menu | | CommonizeSideNav | Desktop fixed / mobile drawer side navigation | | CommonCard | Multi-purpose card supporting title, image, author, citation, link, and various click actions | | CommonizeDrawer | Right slide-in detail panel powered by Zustand | | CardWrapper | Card wrapper with mouse-tracking hover glow effect | | CitationModal | Academic citation modal with MLA / APA / Chicago / Harvard / Vancouver formats | | DocsGuide | Ready-to-use full guide page showcasing all components |

DocsGuide — One-Line Demo Page

The fastest way to see all components in action. Import DocsGuide and render it — that's it.

"use client";

import { DocsGuide } from "@yeonpm/docs-template";

export default function Page() {
  return <DocsGuide version="0.3.0" />;
}

| Prop | Type | Default | Description | |---|---|---|---| | version | string | "latest" | Version string displayed in the header |

Deploy with Next.js

An example Next.js project is included in the example/ directory. To deploy:

cd example
npm install
npm run build   # or deploy to Vercel with Root Directory set to "example"

Quick Start

import {
  CommonizeShell,
  CommonCard,
  CommonizeDrawer,
  useCommonizeDrawerStore,
} from "@yeonpm/docs-template";

function App() {
  const { open } = useCommonizeDrawerStore();

  return (
    <CommonizeShell
      brand={{ title: "My Docs", subtitle: "v1.0" }}
      navItems={[
        { key: "intro", label: "Introduction", target: { type: "hash", id: "intro" } },
        { key: "api", label: "API Reference", target: { type: "hash", id: "api" } },
        { key: "github", label: "GitHub", target: { type: "external", href: "https://github.com" } },
      ]}
    >
      <section id="intro">
        <CommonCard
          title="Getting Started"
          description="Learn how to use this library."
          onClickAsDrawer={() =>
            open({
              panelTitle: "Getting Started",
              body: <p>Detailed walkthrough content goes here...</p>,
            })
          }
        />
      </section>
      <CommonizeDrawer />
    </CommonizeShell>
  );
}

Font Recommendation

All components use font-family: inherit, so they follow whatever font is set on your app's root element. We recommend setting a font on body:

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

API Reference

<CommonizeShell />

Top-level layout shell that combines header, side navigation, and main content.

| Prop | Type | Description | |---|---|---| | brand | CommonizeBrand | Brand info displayed in the header | | navItems | CommonizeNavItem[] | Navigation items for the side nav | | children | React.ReactNode | Main content | | headerRightSlot | React.ReactNode | Optional right-side header slot | | navBottomSlot | React.ReactNode | Optional bottom-side slot in the side nav |

<CommonizeHeader />

Fixed top header bar.

| Prop | Type | Description | |---|---|---| | brand | CommonizeBrand | { title, subtitle?, onClick? } | | rightSlot | React.ReactNode | Right-side slot content | | onHamburgerClick | () => void | Hamburger menu click handler (mobile) |

<CommonizeSideNav />

Desktop: fixed side navigation. Mobile (≤768px): overlay drawer.

| Prop | Type | Default | Description | |---|---|---|---| | items | CommonizeNavItem[] | — | Navigation items | | bottomSlot | React.ReactNode | — | Bottom slot | | width | number | 220 | Nav width in pixels | | headerOffset | number | 64 | Header height offset |

<CommonCard />

Versatile card component used across Education, Publications, Honors, Experience sections, etc.

| Prop | Type | Description | |---|---|---| | title | ReactTextLike | Card title (string or ReactElement) | | subTitle | ReactTextLike | Subtitle | | description | ReactTextLike | Description text | | author | CommonCardAuthor | Author — plain string or { value, isMain? }[] | | period | ReactTextLike | Period / date range | | extra | React.ReactNode | Extra content below the main body | | image | CommonCardImage | { src, alt?, href?, size? } | | linkButton | CommonCardLinkButton | { label?, href } — external link icon | | citation | CommonCardCitation | Citation data — opens CitationModal on quote icon click | | css | string | CSS override for internal class selectors | | onClick | (e) => void | Direct click handler | | hoverable | boolean | Enable hover glow effect | | padding | number | Card padding (default 16) | | className | string | Additional CSS class | | onClickAsNewTab | string \| (e) => void | Open URL or run custom logic in a new tab | | onClickAsPopup | string \| (e) => void | Open URL or run custom logic in a popup window | | onClickAsDrawer | (e) => void | Open a drawer panel |

Click priority: onClickonClickAsDraweronClickAsPopuponClickAsNewTablinkButton.href

<CommonizeDrawer />

Right-side slide-in detail panel. Controlled via useCommonizeDrawerStore.

const { open, close, isOpen, content } = useCommonizeDrawerStore();

// Open the drawer
open({
  panelTitle: "Detail Title",
  subtitle: "Optional subtitle",
  body: <div>Any React content</div>,
});

// Close the drawer
close();

<CardWrapper />

A card container with rounded corners, border, shadow, and an optional mouse-tracking radial glow hover effect.

| Prop | Type | Default | Description | |---|---|---|---| | children | React.ReactNode | — | Card content | | padding | number | 16 | Inner padding | | className | string | — | Additional CSS class | | hoverable | boolean | false | Enable hover glow effect | | onClick | (e) => void | — | Click handler |

<CitationModal />

Dialog for displaying academic citations in 5 formats (MLA, APA, Chicago, Harvard, Vancouver). Supports loading citation data from a CSV file or auto-generating from publication metadata.

| Prop | Type | Description | |---|---|---| | open | boolean | Modal open state | | onClose | () => void | Close handler | | publication | Publication \| null | { title, authors, journal, year, doi?, citationCsv? } |

<DocsGuide />

A pre-built, ready-to-render guide page that demonstrates all components in the library. Includes interactive examples with "View Code" cards and section anchor links.

| Prop | Type | Default | Description | |---|---|---|---| | version | string | "latest" | Version label shown in the header |

Types

All types are available as named exports:

import type {
  ReactTextLike,
  CommonizeNavTarget,
  CommonizeNavItem,
  CommonizeBrand,
  CommonCardAuthor,
  CommonCardImage,
  CommonCardCitation,
  CommonCardLinkButton,
  CommonCardProps,
  CommonizeDrawerContent,
  DocsGuideProps,
} from "@yeonpm/docs-template";

Navigation Target Types

type CommonizeNavTarget =
  | { type: "hash"; id: string; path?: string }  // Scroll to #id
  | { type: "route"; href: string }               // Client-side navigation
  | { type: "external"; href: string };            // Open in new tab

Utilities

import { openExternal, navigateToHash, handleNavTarget } from "@yeonpm/docs-template";

openExternal("https://github.com");         // window.open in new tab
navigateToHash("section-id");               // Smooth scroll to #section-id
handleNavTarget({ type: "hash", id: "api" }); // Handles all nav target types

License

MIT