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

react-headgear

v0.0.1-alpha.1

Published

The AI-native SEO library for React. Intent-based API, self-documenting types, built for agents.

Downloads

97

Readme

react-headgear

The AI-native SEO library for React. Gear up your document head.

npm version MIT License

react-headgear is a modern SEO library for React SPAs with:

  • Self-documenting types - Rich JSDoc that AI agents can read
  • Introspection API - describe(), validate(), preview() for programmatic discovery
  • Schema builders - Typed JSON-LD generation for structured data
  • Zero dependencies - Just React as a peer dependency

Installation

npm install react-headgear

Quick Start

import { useHeadgear } from 'react-headgear';
import { Product } from 'react-headgear/schema';

function ProductPage({ product }) {
  useHeadgear({
    title: `${product.name} | My Store`,
    description: product.description,
    canonical: `https://mystore.com/products/${product.slug}`,
    og: {
      type: 'product',
      image: product.image,
    },
    schema: Product({
      name: product.name,
      price: product.price,
      currency: 'USD',
      image: product.image,
    }),
  });

  return <div>{/* Your component */}</div>;
}

Features

Meta Tags & Open Graph

useHeadgear({
  title: 'Page Title',
  description: 'Page description for search results',
  canonical: 'https://example.com/page',
  noindex: false,
  keywords: ['react', 'seo'],
  og: {
    type: 'website',
    image: '/og-image.png',
    siteName: 'My Site',
  },
  twitter: {
    card: 'summary_large_image',
    site: '@myhandle',
  },
});

Structured Data (JSON-LD)

import { Product, Article, BreadcrumbList, FAQPage } from 'react-headgear/schema';

// Product
Product({
  name: 'Widget Pro',
  price: 29.99,
  currency: 'USD',
  brand: 'Acme',
  image: '/widget.png',
});

// Article
Article({
  headline: 'How to Use react-headgear',
  datePublished: '2025-01-15',
  author: { name: 'Jane Doe' },
});

// Breadcrumbs
BreadcrumbList([
  { name: 'Home', url: '/' },
  { name: 'Products', url: '/products' },
  { name: 'Widget Pro' },
]);

// FAQ
FAQPage([
  { question: 'What is react-headgear?', answer: 'An AI-native SEO library.' },
]);

Introspection API

For AI agents and programmatic use:

import { describe, validate, preview, listPresets } from 'react-headgear';

// Discover preset requirements
const spec = describe('ecommerce.productPage');
// { required: ['name', 'price'], optional: [...], example: {...} }

// Validate config before applying
const result = validate(config);
// { valid: false, errors: [...], warnings: [...] }

// Preview output without side effects
const output = preview(config);
// { meta: [...], jsonLd: {...}, ogImage: {...} }

// List all presets
const presets = listPresets();
// ['ecommerce.productPage', 'blog.articlePage', ...]

API Reference

useHeadgear(config)

React hook that manages document head metadata.

describe(presetName)

Get requirements for a preset. Returns { required, optional, defaults, example }.

validate(config)

Validate a config. Returns { valid, errors, warnings }.

preview(config)

Preview output without side effects. Returns { meta, jsonLd, ogImage }.

Schema Builders

| Builder | Use Case | |---------|----------| | Product() | E-commerce products | | Article() | Blog posts, news | | Organization() | Company info | | Person() | Author profiles | | BreadcrumbList() | Navigation breadcrumbs | | FAQPage() | FAQ sections | | WebSite() | Site-wide metadata |

Why react-headgear?

  • Not just another helmet - Built with AI agents in mind
  • Typed structured data - Schema builders with full TypeScript support
  • Validation included - Catch SEO mistakes before deploy
  • Framework agnostic - Works with any React setup (Vite, CRA, etc.)

License

MIT