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

@izumisy/vitepress-plugin-react-preview

v0.1.1

Published

VitePress plugin for rendering React component previews via iframe

Readme

@izumisy/vitepress-plugin-react-preview

npm

VitePress plugin for rendering live React component previews inside your VitePress documentation site.

Transforms ```tsx preview fenced blocks in Markdown into interactive previews rendered via iframes, with full style isolation and dark mode support.

Features

  • markdown-it plugin — rewrites ```tsx preview blocks into <PreviewBlock> Vue components at the Markdown parsing stage
  • Vite plugin — serves preview modules and standalone preview pages using @izumisy/vite-plugin-react-preview under the hood
  • Style isolation — inline previews render inside iframes; standalone previews run in a separate page
  • Dark mode — syncs with VitePress theme toggle via postMessage
  • Build support — emits standalone HTML pages (/__preview/{blockId}.html) during vitepress build

Install

pnpm add -D @izumisy/vitepress-plugin-react-preview

Setup

In your VitePress config (.vitepress/config.ts):

import { defineConfig } from "vitepress";
import { createMrpPlugin } from "@izumisy/vitepress-plugin-react-preview";

const mrp = createMrpPlugin({
  css: "@my-lib/styles", // optional: CSS to inject into previews
});

export default defineConfig({
  markdown: {
    config(md) {
      md.use(mrp.markdownIt);
    },
  },
  vite: {
    plugins: [mrp.vite()],
  },
});

Then use <PreviewBlock> in your theme if needed:

<script setup>
import PreviewBlock from "@izumisy/vitepress-plugin-react-preview/PreviewBlock.vue";
</script>

Preview Syntax

Works with the same ```tsx preview syntax as @izumisy/md-react-preview:

```tsx preview
import { Button } from "@my-lib"

<Button>Click me</Button>
```

```tsx preview standalone
import { Sheet } from "@my-lib"

<Sheet.Root>...</Sheet.Root>
```
  • inline (default) — rendered within the page via iframe
  • standalone — shows a code block with a link to a full-viewport preview page

License

MIT