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-scheme-aware

v0.1.2

Published

A reusable React **JSON** editor with **JSON Schema** validation and code intelligence, built on [Monaco Editor](https://microsoft.github.io/monaco-editor/).

Downloads

274

Readme

react-scheme-aware

A reusable React JSON editor with JSON Schema validation and code intelligence, built on Monaco Editor.

Features

  • Schema-driven validation — JSON is validated against a JSON Schema (draft-07 compatible); errors are reported via callback and can be shown inline or in a list.
  • Code intelligence — Autocomplete and hover documentation from the schema (Monaco).
  • Controlled or hook-based — Use <JsonSchemaEditor /> with your own state, or useSchemaEditor to manage value and validation errors.
  • Dual use — This repo is both an npm-ready library and a demo app with an API reference.

Demo

Live demo: https://vladyslav-dotsenko.github.io/react-scheme-aware/ (same as the package homepage in package.json).

To run the demo locally:

npm install
npm run dev

Open the URL (e.g. http://localhost:5173). The demo includes example presets, a validation panel, and an API Reference section. The canonical API documentation lives in src/components/JsonSchemaEditor/types.ts (JSDoc); the demo refers to that file as the source of truth.

Install

npm install react-scheme-aware

Peer dependencies: react, react-dom, monaco-editor, @monaco-editor/react. Install the package and its peers in your app to use the library (see Usage).

Usage

With useSchemaEditor (recommended) — the hook holds value and errors; its return is spreadable onto the editor. Optional onChange and onValidationErrors are called in addition to internal updates. When initialValue changes (e.g. preset switch), the hook syncs.

import { JsonSchemaEditor, useSchemaEditor } from 'react-scheme-aware';

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

function MyForm() {
  const schemaEditor = useSchemaEditor({
    initialValue: '{}',
    schema,
    onChange: (value) => { /* optional */ },
    onValidationErrors: (errors) => { /* optional */ },
  });

  return (
    <>
      <JsonSchemaEditor {...schemaEditor} height="300px" />
      {schemaEditor.errors.length > 0 && (
        <ul>{schemaEditor.errors.map((e, i) => <li key={i}>{e.message}</li>)}</ul>
      )}
    </>
  );
}

Controlled (no hook) — manage value and onValidationErrors state yourself and pass them as props to <JsonSchemaEditor />.

API reference (source of truth)

API docs: src/components/JsonSchemaEditor/types.ts (JSDoc). Demo API Reference summarizes it.

Summary:

  • <JsonSchemaEditor /> — Extends EditorProps from @monaco-editor/react; required: value, onChange. Optional: schema, onValidationErrors, minHeight, aria-label, and any upstream Editor props (e.g. height, className, options, onMount). See JsonSchemaEditorProps in types.ts.
  • useSchemaEditor(options) — Options: initialValue (required), schema, onChange, onValidationErrors. Returns props spreadable onto the editor plus errors: ValidationError[]. See UseSchemaEditorOptions and UseSchemaEditorReturn in types.ts.
  • ValidationErrormessage, path?, line?, column?, severity?, code?. See types.ts.

Building

  • Library (npm): npm run build:lib → output in dist/. Only the library entry and JsonSchemaEditor components are built; demo code and app assets are excluded. The published package includes only dist/ (and README.md).
  • Demo app: npm run build.
  • Publishing: Run npm publish; prepublishOnly runs build:lib so the tarball always contains an up-to-date dist/.

License

MIT