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

@stackonward/section-renderer-vue

v0.0.2

Published

Product-neutral Vue 3 adapter for structured section rendering

Readme

@stackonward/section-renderer-vue

Product-neutral Vue 3 adapter for structured section rendering. It provides the component registry, renderer, lazy loading, inline editing, preview-host composition, generic article media sections, and common browser interactions.

Products own their section packs, design tokens, page shells, and product CSS.

Install

pnpm add @stackonward/section-renderer-vue vue

Render article sections

<script setup lang="ts">
import { registerArticleSections, SectionRenderer } from '@stackonward/section-renderer-vue'
import '@stackonward/section-renderer-vue/styles/utilities'

registerArticleSections()
</script>

<template>
  <SectionRenderer :sections-data="article.content_json" />
</template>

registerArticleSections() registers only these generic types:

  • article-image
  • article-custom-html
  • article-prose
  • article-video
  • article-youtube

SectionRendererPlugin separately registers the built-in rich-text reference implementation. A product can call registerSection() for additional types without modifying this package.

Register a product section

import { registerSection } from '@stackonward/section-renderer-vue'

registerSection({
  name: 'product-feature-grid',
  componentName: 'FeatureGrid',
  component: () => import('./FeatureGrid.vue'),
  supportsInlineEdit: true,
})

Section names are the serialized content contract. Keep product-specific names and components in the product-owned registration package.

Admin preview host

The editor entry mounts a full-page preview runtime around a caller-owned postMessage bridge:

import { createPreviewApp, PreviewBridge } from '@stackonward/section-renderer-vue/editor'

const bridge = new PreviewBridge({ allowedOrigin: 'https://admin.example.com' })
bridge.connect()

createPreviewApp('#app', { bridge })

The host accepts section data, raw HTML previews, locale, product context, selection, and theme-token messages. It sends height, readiness, inline-edit, keyboard shortcut, and heartbeat messages. The preview document owns this page-lifetime mount; call bridge.disconnect() when its iframe lifecycle ends.

Common media interactions

The /interactions/common entry provides opt-in DOM behavior for generic article markup:

  • privacy-enhanced YouTube facades that connect only after user intent;
  • native-video metadata loading near the viewport;
  • keyboard and pointer playback toggles;
  • preview-link navigation guards.

article-custom-html scopes the bundled utility classes under .article-content. Import /styles/utilities only where that raw HTML contract is used.

Main API

| API | Purpose | | ------------------------------------------------ | ------------------------------------------------------ | | SectionRenderer | Render ordered section data through the registry | | registerSection, useRegistry | Register and resolve lazy Vue section components | | useLazyRender | Coordinate viewport-driven section rendering | | useInlineEdit | Manage inline setting edits in an editor surface | | useSectionStyle | Convert validated section style data into Vue bindings | | generateSectionJsonLd, generateJsonLdScripts | Project section SEO data into JSON-LD scripts | | safeColor, safeUrl | Re-export the core boundary sanitizers |

Entry points

| Entry point | Purpose | | ------------------------------------------------------- | ------------------------------------------------------ | | @stackonward/section-renderer-vue | Renderer, registry, components, composables, and types | | @stackonward/section-renderer-vue/editor | Preview app and postMessage bridge contracts | | @stackonward/section-renderer-vue/interactions/common | Generic article media and preview interactions | | @stackonward/section-renderer-vue/styles/utilities | Scoped raw-HTML utility CSS |

Unknown section types render through FallbackSection; component render errors are isolated by SectionErrorBoundary. Data validation and transforms remain in @stackonward/section-core.

Compatibility

  • Vue ^3.4.0
  • Modern browsers for lazy rendering, editor preview, and media interactions
  • ESM with TypeScript declarations

Related packages

  • @stackonward/section-core owns framework-independent section contracts and transforms.
  • @stackonward/cms-nuxt composes CMS delivery and article media interactions for Nuxt.

License

MIT