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

@iwritec0de/blockbridge-react

v1.0.0

Published

Render WordPress Gutenberg blocks as React components

Downloads

21

Readme

CI

@iwritec0de/blockbridge-react

Render WordPress Gutenberg blocks as React components.

Pairs with the BlockBridge WP plugin, which exposes a serializedBlocks field on the WordPress REST API. This library renders that payload as a React component tree.

Install

pnpm add @iwritec0de/blockbridge-react
# or
npm i @iwritec0de/blockbridge-react

Usage

import { BlockContent } from '@iwritec0de/blockbridge-react';
import '@iwritec0de/blockbridge-react/style.css';

export default function Post({ post }) {
  return <BlockContent blocks={post.serializedBlocks} />;
}

post.serializedBlocks is the array returned by the BlockBridge WP plugin's REST field.

Supported Blocks

| Block | Component | Notes | |-------|-----------|-------| | core/paragraph | Paragraph | | | core/heading | Heading | Levels 1–6 | | core/image | Image | Caption, link wrapping | | core/gallery | Gallery | Grid layout, cropped images | | core/list | List | Ordered and unordered | | core/list-item | ListItem | Nested lists via children | | core/quote | Quote | Citation support | | core/button | Button | Colors, border radius, link targets | | core/buttons | Buttons | Flex container for button groups | | core/group | Group | Any tagName, colors | | core/columns | Columns | Stacked on mobile | | core/column | Column | Variable width | | core/cover | Cover | Background image, overlay, parallax, focal point | | core/media-text | MediaText | Side-by-side text + image/video | | core/audio | Audio | Native <audio> with controls | | core/video | Video | Native <video> with controls | | core/file | File | Download button | | core/separator | Separator | | | core/spacer | Spacer | | | core/table | Table | Head / body / foot | | core/embed | Embed | YouTube, Vimeo (responsive iframe), Twitter (blockquote), generic | | Any other block | DefaultBlock | Falls back to raw innerHTML |

Custom serializers

Override how any block renders by passing userSerializers:

const serializers = {
  'core/quote': ({ content, citation, children }) => (
    <blockquote className="my-quote">
      {children}
      {citation && <cite>{citation}</cite>}
    </blockquote>
  ),
};

<BlockContent blocks={blocks} userSerializers={serializers} />

The serializer receives the block's attributes spread as props, plus a children prop for blocks with nested inner blocks. The key is the Gutenberg block name (core/quote, core/heading, etc.).

Theming

All visual styles are driven by CSS custom properties prefixed with --bb-*. Override them on any wrapper to retheme:

.my-content {
  --bb-color-primary: #4f46e5;
  --bb-font-family: 'Inter', sans-serif;
  --bb-content-width: 720px;
}

See src/css/tokens.css for the full token list. Key tokens:

| Token | Default | Description | |-------|---------|-------------| | --bb-color-text | #191e23 | Body text color | | --bb-color-bg | #fff | Background color | | --bb-color-primary | #0693e3 | Links, buttons | | --bb-font-family | System sans-serif | Body font stack | | --bb-font-size-base | 16px | Base font size | | --bb-line-height | 1.8 | Body line height | | --bb-content-width | 610px | Max content width | | --bb-block-margin | 28px | Vertical spacing between blocks |

Demo

pnpm demo

Boots a Dockerized WordPress instance with seeded block content plus a Next.js demo site at http://localhost:3000.

pnpm demo:down   # Stop and remove containers + volumes

Development

pnpm install     # Install dependencies
pnpm dev         # Start webpack dev server
pnpm build       # Build to lib/
pnpm test        # Run tests (Jest)
pnpm typecheck   # TypeScript check
pnpm lint        # ESLint

Project structure

praser/
├── src/
│   ├── components/         # One directory per block type
│   ├── Utils/              # blocksToElements, getSerializers, cleanName
│   ├── css/
│   │   ├── tokens.css      # All CSS custom properties
│   │   ├── base.css        # Global resets + base styles
│   │   └── blocks/         # Per-block styles
│   └── index.ts            # Package entry — exports BlockContent + all components
├── lib/                    # Build output (not committed)
└── docs/                   # VitePress documentation site

License

GPL-3.0-or-later