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

cf-json-schema-viz

v0.3.0

Published

A lightweight, CSS-in-JS-free React component for rendering JSON Schema definitions. Fork of @stoplight/json-schema-viewer.

Readme

cf-json-schema-viz

A lightweight, CSS-in-JS-free React component for rendering JSON Schema definitions in a collapsible tree view.

This is a fork of @stoplight/json-schema-viewer, rewritten to remove Tailwind CSS and other heavy dependencies, making it suitable for use as a standalone package in documentation sites.

Why This Fork?

The original @stoplight/json-schema-viewer is an excellent component, but it relies on Stoplight's Mosaic design system which brings in Tailwind CSS and other dependencies that may conflict with existing styling systems. This fork:

  • No Tailwind CSS - Uses pure CSS with CSS custom properties for theming
  • No Mosaic dependencies - Removed @stoplight/mosaic and related packages
  • Smaller bundle - Significantly reduced dependency footprint
  • CSS custom properties - Easy theming via CSS variables
  • Dark mode support - Built-in dark mode via data-theme="dark"

Installation

npm install cf-json-schema-viz
# or
pnpm add cf-json-schema-viz
# or
yarn add cf-json-schema-viz

Usage

import { JsonSchemaViewer } from 'cf-json-schema-viz';
import 'cf-json-schema-viz/styles.css';

const schema = {
  type: 'object',
  properties: {
    name: { type: 'string', description: 'The name of the item' },
    count: { type: 'integer', minimum: 0 },
  },
  required: ['name'],
};

function App() {
  return (
    <JsonSchemaViewer
      schema={schema}
      defaultExpandedDepth={2}
      maxHeight={500}
    />
  );
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | schema | JSONSchema | required | The JSON Schema to render | | defaultExpandedDepth | number | 1 | How many levels to expand by default | | maxHeight | number | - | Maximum height in pixels (enables scrolling) | | emptyText | string | 'No schema defined' | Text shown when schema is empty | | disableCrumbs | boolean | false | Disable the breadcrumb header | | data-theme | 'dark' \| 'light' | - | Theme mode |

Theming

The component uses CSS custom properties for theming. You can override these variables:

:root {
  --jsv-font-sans: ui-sans-serif, system-ui, sans-serif;
  --jsv-font-mono: ui-monospace, monospace;
  --jsv-font-size: 0.875rem;
  
  --jsv-color-body: #1a1a1a;
  --jsv-color-muted: #6b7280;
  --jsv-color-border: #e5e7eb;
  --jsv-color-canvas: #f4f4f5;
  --jsv-color-bg: #ffffff;
  
  --jsv-color-primary: #f6821f;
  --jsv-color-danger: #dc2626;
  --jsv-color-warning: #f97316;
  --jsv-color-success: #16a34a;
}

For dark mode, the component automatically adjusts colors when data-theme="dark" is set on the component or a parent element.

Features

  • Full JSON Schema Draft 4+ support, including oneOf and anyOf combiners
  • Renders nested objects to any depth
  • Collapsible sections
  • Validation properties display
  • Markdown descriptions
  • Sticky breadcrumb header showing current path when scrolling
  • Keyboard accessible

Credits

This project is a fork of @stoplight/json-schema-viewer by Stoplight. The core schema parsing is powered by @stoplight/json-schema-tree.

License

Apache-2.0 (same as the original project)