New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@yeonpm/docs-template

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yeonpm/docs-template

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

latest
Source
npmnpm
Version
0.4.4
Version published
Maintainers
1
Created
Source

@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

ComponentDescription
CommonizeShellTop-level layout combining Header + SideNav + main content area
CommonizeHeaderFixed top header with brand title, right slot, and mobile hamburger menu
CommonizeSideNavDesktop fixed / mobile drawer side navigation
CommonCardMulti-purpose card supporting title, image, author, citation, link, and various click actions
CommonizeDrawerRight slide-in detail panel powered by Zustand
CardWrapperCard wrapper with mouse-tracking hover glow effect
CitationModalAcademic citation modal with MLA / APA / Chicago / Harvard / Vancouver formats
DocsGuideReady-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" />;
}
PropTypeDefaultDescription
versionstring"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.

PropTypeDescription
brandCommonizeBrandBrand info displayed in the header
navItemsCommonizeNavItem[]Navigation items for the side nav
childrenReact.ReactNodeMain content
headerRightSlotReact.ReactNodeOptional right-side header slot
navBottomSlotReact.ReactNodeOptional bottom-side slot in the side nav

<CommonizeHeader />

Fixed top header bar.

PropTypeDescription
brandCommonizeBrand{ title, subtitle?, onClick? }
rightSlotReact.ReactNodeRight-side slot content
onHamburgerClick() => voidHamburger menu click handler (mobile)

<CommonizeSideNav />

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

PropTypeDefaultDescription
itemsCommonizeNavItem[]Navigation items
bottomSlotReact.ReactNodeBottom slot
widthnumber220Nav width in pixels
headerOffsetnumber64Header height offset

<CommonCard />

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

PropTypeDescription
titleReactTextLikeCard title (string or ReactElement)
subTitleReactTextLikeSubtitle
descriptionReactTextLikeDescription text
authorCommonCardAuthorAuthor — plain string or { value, isMain? }[]
periodReactTextLikePeriod / date range
extraReact.ReactNodeExtra content below the main body
imageCommonCardImage{ src, alt?, href?, size? }
linkButtonCommonCardLinkButton{ label?, href } — external link icon
citationCommonCardCitationCitation data — opens CitationModal on quote icon click
cssstringCSS override for internal class selectors
onClick(e) => voidDirect click handler
hoverablebooleanEnable hover glow effect
paddingnumberCard padding (default 16)
classNamestringAdditional CSS class
onClickAsNewTabstring | (e) => voidOpen URL or run custom logic in a new tab
onClickAsPopupstring | (e) => voidOpen URL or run custom logic in a popup window
onClickAsDrawer(e) => voidOpen 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.

PropTypeDefaultDescription
childrenReact.ReactNodeCard content
paddingnumber16Inner padding
classNamestringAdditional CSS class
hoverablebooleanfalseEnable hover glow effect
onClick(e) => voidClick 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.

PropTypeDescription
openbooleanModal open state
onClose() => voidClose handler
publicationPublication | 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.

PropTypeDefaultDescription
versionstring"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

Keywords

react

FAQs

Package last updated on 12 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts