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

@qitplus/guijson

v1.0.0

Published

A package for using the guijson format

Readme

GuiJson

TypeScript types for a GUI JSON schema inspired by GeoJSON.

guijson provides a typed way to describe UI trees as JSON objects. Like GeoJSON, every object is identified by a type field, which makes the schema easy to serialize, inspect, validate, and render in your own runtime.

Installation

npm install guijson

What It Includes

  • A GuiJson union for all supported GUI JSON nodes
  • Component types for Container, Image, Text, Button, TextInput, Switch, Column, Row, and Stack
  • Reference types for normalized schemas: Reference and ReferenceCollection
  • A ComponentCollection type for storing reusable component definitions
  • Generic parameters for custom id, style, and properties shapes
  • Tuple-based Action types for events such as onPress and onChange

Quick Example

import type { GuiJson } from 'guijson';

type Style = {
  padding?: number;
  gap?: number;
  fontSize?: number;
};

type Props = {
  testId?: string;
};

const screen: GuiJson<string, Style, Props> = {
  type: 'Column',
  id: 'home',
  style: { padding: 24, gap: 12 },
  properties: { testId: 'home-screen' },
  children: [
    {
      type: 'Text',
      text: 'Hello, GuiJson',
      style: { fontSize: 20 },
    },
    {
      type: 'TextInput',
      value: '',
      placeholder: 'Search',
      onChange: ['setSearch'],
    },
    {
      type: 'Button',
      onPress: ['navigate', 'details'],
      child: {
        type: 'Text',
        text: 'Open details',
      },
    },
  ],
};

Core Shape

Every GUI JSON object includes:

  • type: the node discriminator
  • id?: an optional string or number identifier

Every component may also include:

  • class?: a class-like label
  • style?: any style shape you define through generics
  • properties?: any custom metadata shape you define through generics

Supported Types

Components

  • Container
  • Image
  • Text
  • Button
  • TextInput
  • Switch
  • Column
  • Row
  • Stack

Collections and References

  • ComponentCollection
  • Reference
  • ReferenceCollection

Events

Interactive components use the Action tuple type:

type Action<K extends string = string, A extends Array<any> = Array<any>> =
  [call: K, ...arguments: A];

That means event handlers can stay fully serializable:

const action = ['navigate', 'settings'] as const;

References Example

Use references if you want reusable or normalized component definitions.

import type { ComponentCollection, Reference } from 'guijson';

const components: ComponentCollection = {
  type: 'ComponentCollection',
  components: [
    { id: 'title', type: 'Text', text: 'Dashboard' },
    { id: 'hero', type: 'Image', src: '/hero.png', alt: 'Hero image' },
  ],
};

const titleRef: Reference = {
  type: 'Reference',
  reference: 'title',
};

Notes

  • This package currently ships TypeScript declarations only.
  • It does not include a renderer, parser, or runtime validator.
  • It also exposes a global GuiJSON namespace for non-module usage.

License

MIT