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

sanity-plugin-mermaid-content-model

v0.3.0

Published

Sanity Studio plugin that renders the content model as a Mermaid class diagram.

Readme

Sanity Mermaid Content Model

npm version CI & Release License: MIT semantic-release: conventionalcommits

Render Sanity content models as Mermaid class diagrams inside Studio.

You probably created a visual representation of your content model at some point in your Studio design process. Is it still accurate? The Mermaid Content Model plug-in provides an up-to-date view of the actual structure of a Sanity project's content model. Use it to understand and communicate the current state of your content model, identify model drift and doc rot, and mitigate the unintended consequences of iterating a content model over time.

Mermaid content model screen showing a Mermaid class diagram and Element filtering options.

Features

  • Document and object types are derived from the Studio compiled schema, so types contributed by other plugins are included in the graph.
  • Attribute cardinality is captured from the compiled scheme and displayed in the model: requirement, min-count, and max-count are supported.
  • Custom attribute validation rules are indicated by a "custom" denotation next to cardinality constraints.
  • Document and object visibility can be modified using the "Elements" options, allowing you to focus on particular parts of your model and identify shared attribute duplication and orphan objects.
  • Customized models can be copied as a PNG or as Mermaid code, allowing you to edit or further transform the document in interoperable Mermaid editors like Mermaid.ai, Mermaid Viewer, and Mermalaid.

Installation

Compatible with Sanity Studio v5 and v6 (React 19).

npm install sanity-plugin-mermaid-content-model
# or
pnpm add sanity-plugin-mermaid-content-model
# or
yarn add sanity-plugin-mermaid-content-model

Usage

Add the plugin to your Studio config and open the Content Model tool from the top navigation:

// sanity.config.ts
import {defineConfig} from 'sanity'
import {mermaidContentModel} from 'sanity-plugin-mermaid-content-model'

export default defineConfig({
  // ...
  plugins: [mermaidContentModel()],
})

License

MIT © Andy Fitzgerald

Development

This repo bundles a dev Studio as a workspace member (studio/). Run it and open the Content Model tool:

pnpm dev

Scripts

| Script | Purpose | | ----------------- | --------------------------------------- | | pnpm test | Run the Vitest suite once. | | pnpm test:watch | Watch mode. | | pnpm typecheck | tsc --noEmit against src + configs. | | pnpm build | Build dist/ with @sanity/pkg-utils. |