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

@robeasthope/ui

v4.2.0

Published

React component library with Storybook, Tailwind CSS v4, and Sanity CMS integration

Readme

@robeasthope/ui

React component library with Storybook, Tailwind CSS v4, and Sanity CMS integration.

📦 Installation

npm install @robeasthope/ui
# or
pnpm add @robeasthope/ui
# or
yarn add @robeasthope/ui

Using in Your Project

Import components and utilities from the package:

import { Box, Container, Type } from "@robeasthope/ui/components";
import { cn } from "@robeasthope/ui/utils";

🚀 Development

All commands should be run from the monorepo root:

# Start Storybook development server
pnpm dev
# or
pnpm storybook

# Run tests
pnpm test

# Run tests with UI
pnpm test:ui

# Run linting
pnpm lint

# Fix linting issues
pnpm lint:fix

# Build TypeScript
pnpm build

# Build static Storybook
pnpm build-storybook

🧩 Components

Layout Components

| Component | Description | Features | | ------------- | ------------------------- | ----------------------------------------- | | Box | Polymorphic box component | Semantic HTML support, as prop | | Container | Responsive container | Max-width constraints, responsive padding | | Type | Typography component | Heading and paragraph variants |

Link Components

| Component | Description | Framework | | -------------------- | -------------------------------- | ------------------ | | EmailLink | Email link with Sanity schema | Framework-agnostic | | ExternalLink | External link with Sanity schema | Framework-agnostic | | NextInternalLink | Internal link for Next.js | Next.js | | ReactRouterLink | Internal link for React Router | React Router | | OmniLink | Universal link component | Multi-framework |

Content Components

| Component | Description | Use Case | | --------------- | ---------------------------- | ---------------------- | | SanityProse | Rich text with Portable Text | Dynamic content | | BasicProse | Simple prose component | Basic formatting | | FullProse | Full-featured prose | All formatting options |

🛠️ Utilities

// Tailwind class merging utility
import { cn } from "@protomolecule/ui/utils";

const className = cn(
  "base-class",
  conditional && "conditional-class",
  "override-class",
);

🎨 Styling

This package uses Tailwind CSS v4 with CSS-based configuration. The configuration is located in the package root and includes:

  • Custom color system via @robeasthope/colours
  • Responsive design utilities
  • Component-specific styles

🧪 Testing

Tests are co-located with components using the .test.tsx extension:

# Run all tests
pnpm test

# Run tests with UI
pnpm test:ui

# Run tests in watch mode
pnpm test --watch

Testing stack:

  • Vitest for test runner
  • Testing Library for component testing
  • happy-dom for DOM environment

📚 Sanity CMS Integration

Components with CMS integration include:

component/
├── Component.tsx          # React component
├── Component.test.tsx     # Tests
├── Component.stories.ts   # Storybook stories
├── Component.schema.ts    # Sanity schema definition
└── Component.query.ts     # GROQ queries

Using Sanity Schemas

import { emailLinkSchema } from "@robeasthope/ui/components/EmailLink/EmailLink.schema";

// Use in your Sanity configuration
export default {
  types: [emailLinkSchema /* other schemas */],
};

🎭 Storybook

Interactive component documentation and playground:

# Start Storybook dev server
pnpm storybook

# Build static Storybook
pnpm build-storybook

Access at: http://localhost:6006

Story Structure

Stories are co-located with components:

// Component.stories.ts
import type { Meta, StoryObj } from "@storybook/react";
import { Component } from "./Component";

const meta: Meta<typeof Component> = {
  title: "Category/Component",
  component: Component,
};

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

export const Default: Story = {
  args: {
    // default props
  },
};

🔧 Configuration

TypeScript

Uses shared configuration from @robeasthope/tsconfig:

  • Strict mode enabled
  • Path aliasing: @/./src/
  • React 19 JSX transform

ESLint

Uses shared configuration from @robeasthope/eslint-config:

  • TypeScript rules
  • React best practices
  • Accessibility checks

📁 Project Structure

packages/ui/
├── src/
│   ├── components/        # React components
│   │   └── [Component]/
│   │       ├── index.ts
│   │       ├── Component.tsx
│   │       ├── Component.test.tsx
│   │       ├── Component.stories.ts
│   │       └── Component.schema.ts
│   └── utils/            # Utility functions
├── .storybook/           # Storybook configuration
├── tailwind.config.ts    # Tailwind CSS v4 config
├── tsconfig.json         # TypeScript config
├── vite.config.ts        # Vite configuration
└── package.json

🤝 Contributing

  1. Create a new component in src/components/
  2. Add tests, stories, and schemas
  3. Run tests and linting
  4. Update this README if needed
  5. Submit a PR

📄 License

MIT License - see LICENSE file in the root directory.

This software is provided "as is", without warranty of any kind. Use at your own risk.