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

tsx-schema-markup

v1.0.2

Published

A package for adding schema markup to your tsx page

Downloads

135

Readme

🧩 tsx-schema-markup

A package for adding schema markup to your TSX pages — typed, composable, and SEO-friendly.

Overview

tsx-schema-markup is a library of TypeScript + React components that help you add schema.org structured data to your web pages in a clean, strongly typed way. It's built on top of schema-dts and is compatible with Google's Search Gallery recommendations.

This package makes it easy to:

  • Embed valid JSON-LD inside <script type="application/ld+json">
  • Compose markup with ergonomic, typed React components
  • Use a general-purpose fallback component for custom types

✨ Features

  • Componentized Markup — Just use <ProfilePage ... />, <Article />, <Breadcrumb />, etc.
  • 🔒 Fully Typed with schema-dts — Autocomplete + validation in your editor.
  • 🌍 SEO-Friendly — Produces valid markup for rich search results.
  • ⚙️ Custom Support — Use <StructuredMarkup thing={...} /> for ad-hoc data.

📦 Installation

npm install tsx-schema-markup
# or
yarn add tsx-schema-markup

🚀 Usage

Prebuilt Components

Use prebuilt components like <ProfilePage />, <Article />, <Breadcrumb />, etc., for common structured data types supported by Google.

import { ProfilePage } from "tsx-schema-markup/dist/profile-page";
import type { Person } from "schema-dts";

const person: Person = {
  "@type": "Person",
  name: "Jane Doe",
  sameAs: ["https://twitter.com/janedoe"],
};

<ProfilePage
  dateCreated={new Date().toISOString()}
  dateModified={new Date().toISOString()}
  mainEntity={person}
/>;

This renders:

<script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "ProfilePage",
    "dateCreated": "...",
    "dateModified": "...",
    "mainEntity": {
      "@type": "Person",
      "name": "Jane Doe",
      "sameAs": ["https://twitter.com/janedoe"]
    }
  }
</script>

Generic Component

For any valid schema.org object, use:

import { StructuredMarkup } from "tsx-schema-markup/dist/structured-markup";
import type { Person } from "schema-dts";

const person: Person = {
  "@type": "Person",
  name: "John Doe",
  url: "https://example.com",
};

<StructuredMarkup thing={person} />;

📚 Included Components

All recommended structured data types from Google Search Gallery are supported, including:

  • Article
  • BreadcrumbList
  • Event
  • FAQPage
  • HowTo
  • JobPosting
  • LocalBusiness
  • Product
  • ProfilePage
  • Recipe
  • Review
  • VideoObject
  • ...and more.

🧪 Type Safety

All components are strongly typed using schema-dts, a comprehensive TypeScript definition of schema.org. This gives you:

  • Full autocomplete and validation in your editor
  • Precise typing for all structured data fields
  • Confidence that your markup adheres to spec

Heads-up: schema-dts is huge — it includes every schema.org type and property. This can occasionally make editors (especially VS Code) wheeze, particularly in larger projects or on slower machines.

🧘‍♂️ Fortunately, this affects only the developer experience — the typing is completely erased at compile time and has no impact on your runtime bundle.

If you're familiar with splitting TypeScript type definitions or managing large .d.ts files more efficiently, contributions are very welcome!


📄 License

ISC