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

@fnd-platform/component-library

v1.0.0-alpha.7

Published

Projen project class for generating Storybook-based component library packages in fnd-platform

Readme

@fnd-platform/component-library

Projen project class for generating Storybook-based component library packages with React and Tailwind CSS in fnd-platform monorepos.

Installation

npm install -D @fnd-platform/component-library
# or
pnpm add -D @fnd-platform/component-library

Quick Start

Add a component library package to your monorepo in .projenrc.ts:

import { FndMonorepoProject } from '@fnd-platform/core';
import { FndComponentLibraryProject } from '@fnd-platform/component-library';

const monorepo = new FndMonorepoProject({
  name: 'my-app',
  defaultReleaseBranch: 'main',
});

const ui = new FndComponentLibraryProject({
  parent: monorepo,
  name: 'ui',
  outdir: 'packages/ui',
  storybookPort: 6006,
});

monorepo.synth();

Or use the CLI:

fnd add component-library --name=ui

Configuration Options

| Option | Type | Default | Description | | ------------------ | -------------------- | ----------------- | ------------------------- | | parent | FndMonorepoProject | required | Parent monorepo | | name | string | required | Package name | | outdir | string | packages/{name} | Output directory | | storybookVersion | string | '^8.0.0' | Storybook version | | storybookPort | number | 6006 | Storybook dev server port |

What Gets Generated

packages/ui/
├── src/
│   ├── components/
│   │   ├── Button/
│   │   │   ├── Button.tsx
│   │   │   ├── Button.stories.tsx
│   │   │   ├── Button.test.tsx
│   │   │   └── index.ts
│   │   └── index.ts
│   ├── styles/
│   │   └── globals.css
│   └── index.ts
├── .storybook/
│   ├── main.ts
│   ├── preview.ts
│   └── preview-head.html
├── package.json
├── tailwind.config.js
├── tsconfig.json
├── tsconfig.build.json
└── vitest.config.ts

Features

  • Storybook 8.x - Latest Storybook with React and Vite
  • React Components - TypeScript React components
  • Tailwind CSS - Utility-first styling
  • Vitest - Fast unit testing
  • TypeScript - Full type safety
  • Auto-generated Stories - Component story templates

Examples

Creating a Component

// src/components/Card/Card.tsx
import { type ReactNode } from 'react';
import { cn } from '../../lib/utils';

export interface CardProps {
  children: ReactNode;
  className?: string;
  variant?: 'default' | 'outlined';
}

export function Card({ children, className, variant = 'default' }: CardProps) {
  return (
    <div
      className={cn(
        'rounded-lg p-4',
        variant === 'default' && 'bg-white shadow',
        variant === 'outlined' && 'border border-gray-200',
        className
      )}
    >
      {children}
    </div>
  );
}

Writing Stories

// src/components/Card/Card.stories.tsx
import type { Meta, StoryObj } from '@storybook/react';
import { Card } from './Card';

const meta: Meta<typeof Card> = {
  title: 'Components/Card',
  component: Card,
  tags: ['autodocs'],
  argTypes: {
    variant: {
      control: 'select',
      options: ['default', 'outlined'],
    },
  },
};

export default meta;
type Story = StoryObj<typeof Card>;

export const Default: Story = {
  args: {
    children: 'Card content',
  },
};

export const Outlined: Story = {
  args: {
    children: 'Outlined card content',
    variant: 'outlined',
  },
};

Writing Tests

// src/components/Card/Card.test.tsx
import { render, screen } from '@testing-library/react';
import { describe, it, expect } from 'vitest';
import { Card } from './Card';

describe('Card', () => {
  it('renders children', () => {
    render(<Card>Hello</Card>);
    expect(screen.getByText('Hello')).toBeInTheDocument();
  });

  it('applies variant class', () => {
    const { container } = render(<Card variant="outlined">Content</Card>);
    expect(container.firstChild).toHaveClass('border');
  });
});

Exporting Components

// src/components/index.ts
export { Button } from './Button';
export type { ButtonProps } from './Button';

export { Card } from './Card';
export type { CardProps } from './Card';

// src/index.ts
export * from './components';

Development

# Start Storybook development server
cd packages/ui
pnpm storybook

# Build Storybook for production
pnpm build-storybook

# Run tests
pnpm test

# Build the library
pnpm build

# Type check
pnpm typecheck

Using in Other Packages

Import components in your frontend or CMS packages:

// In packages/frontend/app/routes/_index.tsx
import { Button, Card } from '@my-app/ui';

export default function Home() {
  return (
    <Card>
      <h1>Welcome</h1>
      <Button>Get Started</Button>
    </Card>
  );
}

API Reference

See the full API documentation for detailed type definitions and examples.

Project Class

  • FndComponentLibraryProject - Projen project class for component library packages

Types

import type { FndComponentLibraryProjectOptions } from '@fnd-platform/component-library';

Requirements

  • Node.js 20+
  • pnpm 8+
  • @fnd-platform/core

Related

License

MIT