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

@m10c/content-elements

v0.0.3

Published

CMS content elements bundle (block editor, SEO, variants)

Readme

Content Elements

A React library that adds small "elements" of CMS functionality. It powers a block-based page editor in the admin app and renders that content (with live preview) in the web app. It pairs with @m10c/mui-kit for the underlying form/theme primitives.

A page is a list of typed blocks — e.g. a hero, an info section, feature cards. Each block has a type and a data object. The admin app edits this list of blocks; the web app reads it and renders each block. The shared Block types keep both sides in agreement on the shape of that data.

Admin editor

The editor is two components:

  • PageEditor — edits the page's blocks. It renders a form for the block list on one side and a live preview iframe (pointed at the web app) on the other. field is a react-typed-form field holding the Block[]; previewUrl is the deployed web app's origin; pagePath is the page being edited ('home' maps to the site root). previewContent is the current form state, which is what gets streamed to the preview.
  • SeoEditor — edits a page's SEO title, description, and share image.
import { PageEditor } from '@m10c/content-elements';

<PageEditor
  blockTypes={blockTypes}
  field={form.getField('blocks')}
  previewUrl={websitePreviewUrl}
  pagePath={page.path}
  previewContent={form.values}
  onPublish={() => form.handleSubmit()}
/>

Each block field can be rendered with a custom input by passing renderers (e.g. a rich-text or image-upload field for certain field kinds); otherwise a default input is used.

Website data fetching

Fetch the page on the server, pass it to useWebsitePageData as initialData, and render the blocks it returns:

import { useWebsitePageData } from '@m10c/content-elements/hooks';

const { data } = useWebsitePageData({ path: 'about', initialData });
// render each block by its type…

useWebsitePageData returns the server-fetched content for the live page, and transparently swaps in preview content when the page is open inside the editor (see below).

For site-wide content like a footer, useWebsiteGlobalData works the same way but reads a global by its CMS path (e.g. 'footer').

Live preview

While editing, the admin shows the web app in an iframe and streams the in-progress edits into it, so the page updates instantly without saving. The admin side is handled by PageEditor; the web side by useWebsitePageData — neither app needs extra setup.

The only requirement is that the admin's previewUrl is set to the web app's exact origin (matching scheme, host, and port), since that's the page the editor loads and sends edits to.