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

@wizestudio/renderer-react

v0.1.2

Published

Renders a WizeStudio layout document as React components, plus the edit-mode canvas client.

Readme

@wizestudio/renderer-react

Renders a WizeStudio layout document as React components — plus defineWidget for authoring them, and the edit-mode canvas the editor drives.

Where this sits

WizeStudio is a visual page builder for headless CMS platforms. It never stores HTML: a page is a normalized JSON document from @wizestudio/schema, and this package is what turns one into React elements by calling your components.

It is where widgets are authored (defineWidget) and where they are rendered — both in production (WizeRenderer) and inside the editor's canvas (WizeCanvas). Both entry points call the same components, which is the property that keeps the editor honest. On Next.js, use @wizestudio/renderer-next on top of this.

Install

npm install @wizestudio/renderer-react

React 18 or later is a peer dependency.

Authoring a widget

import { defineWidget } from '@wizestudio/renderer-react';

export const Hero = defineWidget<{ heading: string }>({
  type: 'acme/hero',
  title: 'Hero',
  category: 'content',
  props: {
    type: 'object',
    properties: { heading: { type: 'string', default: 'Welcome' } },
    required: ['heading'],
  },
  ui: { fields: { heading: { control: 'text' } } },
  styles: ['spacing', 'background'],
  component: ({ heading, wize }) => (
    <section {...wize.attrs}>
      <h1>{heading}</h1>
    </section>
  ),
});

wize.attrs must be spread onto the root element: it carries the generated style class and, in edit mode, the identifier the canvas hit-tests against. A widget that drops it renders unstyled and cannot be selected.

createPack then splits a set of definitions into the two halves that live on opposite sides of the bridge — manifests for the editor, components for the renderer:

export const { manifests, components } = createPack([Hero, Pricing, Faq]);

The component never crosses that boundary. That is what makes "developers own the components" structurally true rather than a slogan.

Rendering

import { WizeRenderer } from '@wizestudio/renderer-react';

<WizeRenderer document={layout} components={components} context={{ data: { page } }} />

WizeRenderer is usable in a React Server Component: no hooks, no effects, no class components, no runtime style injection. It emits no markup of its own beyond a <style> element and a wrapper. Supplying context.onError opts into the client-side error boundary, and therefore into a client component.

The canvas

// app/wizestudio/canvas/page.tsx
'use client';
import { WizeCanvas } from '@wizestudio/renderer-react';
import { components } from './widgets';

export default function Canvas() {
  return <WizeCanvas components={components} allowedOrigins={['https://cms.example.com']} />;
}

The editor frames this route and drives it over @wizestudio/canvas-bridge, so the canvas is a preview of the real site rendered with the real components rather than an approximation of them. All hit-testing and measurement happen here and travel back as geometry; the editor never reaches into this document, because in production the two are different origins.

allowedOrigins is a security boundary, not a formality. Anything you allow can read and rewrite the page being edited. Never use *.

Key exports

| Export | Purpose | |---|---| | defineWidget | Pairs a React component with a manifest; validates the widget type at definition time | | createPack | Splits definitions into { manifests, components } | | WizeRenderer | The recursive renderer. RSC-safe | | renderNode | Renders one node, for callers driving the recursion themselves | | WizeCanvas | The edit-mode canvas client | | WidgetBoundary | The client-side error boundary a failing widget is isolated by | | buildStylesheet | Deterministic CSS generation — returns { css, classes } | | WidgetProps, WidgetRuntime, ComponentMap, RenderContext | The authoring and rendering types |

Licence

MIT.

WizeStudio is open core, and this package is on the production render path. It is MIT deliberately and contains no licensing code of any kind, which is what makes "a lapsed subscription cannot break your live site" a property of the build rather than a promise. schema, core, canvas-bridge, renderer-next and cli are MIT for the same reason; the authoring side — editor, plugin-strapi, components, cms-strapi — is commercial.


wizestudio.wizeb.com