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/md-react-preview

v0.1.1

Published

md-react-preview — component previewer powered by MDX

Downloads

212

Readme

@izumisy/md-react-preview

npm

CLI and programmatic API for md-react-preview — a zero-config component previewer for React projects.

Drop Markdown files into docs/ with ```tsx preview fenced blocks and get a Vite-powered dev server with live component previews and syntax-highlighted source code.

Install

pnpm add -D @izumisy/md-react-preview

CLI

npx mrp dev       # Start dev server (default port 3040)
npx mrp build     # Build static output
npx mrp preview   # Preview the production build locally

Writing Previews

Create a Markdown file under docs/:

---
title: Button
description: A versatile button component.
---

## Default

```tsx preview
import { Button } from "./Button"

<Button variant="default">Click me</Button>
```

Each ```tsx preview block is rendered as a live component alongside collapsible, syntax-highlighted source code. Previews run in isolated iframes so host styles never leak.

Preview Modes

| Mode | Syntax | Behavior | |------|--------|----------| | inline (default) | ```tsx preview | Rendered inline within the page | | standalone | ```tsx preview standalone | Rendered in a dedicated full-viewport page at /__preview/{blockId} |

Standalone mode is useful for portal/overlay components (Dropdown, Sheet, Dialog) and full-page layouts that need the entire viewport.

Block Options

Options can be set as key="value" pairs or boolean flags in the fence meta:

```tsx preview wrap="row" height="200"
<Button>A</Button>
<Button>B</Button>
```

| Option | Description | |--------|-------------| | wrap | Layout mode: "row" (horizontal with gap) or "column" (vertical with gap) | | height | Fixed iframe height (e.g. "200") | | standalone | Boolean flag — render in a separate full-viewport page |

Frontmatter

| Field | Description | |-------|-------------| | title | Display name in the sidebar and page header | | description | Short description shown below the title |

Configuration

Create a mrp.config.ts at your project root:

import { defineConfig } from "@izumisy/md-react-preview";

export default defineConfig({
  title: "My Component Library",
  glob: "docs/**/*.md",              // default
  previewCss: "./src/globals.css",   // optional
  vite: {
    plugins: [],                     // extra Vite plugins
  },
});

| Option | Description | |--------|-------------| | title | Sidebar header and HTML <title> | | glob | Glob pattern for Markdown files (default docs/**/*.md) | | previewCss | CSS file imported into preview blocks (e.g. your design system's stylesheet) | | vite.plugins | Additional Vite plugins (e.g. @tailwindcss/vite) |

Programmatic API

import { startDev, runBuild, defineConfig, createPreviewerViteConfig } from "@izumisy/md-react-preview";

| Export | Description | |--------|-------------| | defineConfig(config) | Type helper for mrp.config.ts | | startDev(options) | Start the Vite dev server | | runBuild(options) | Run the production build | | runPreview(options) | Preview the production build | | createPreviewerViteConfig(options) | Generate the Vite InlineConfig used internally | | extractPreviewBlocks(source) | Parse ```tsx preview blocks from a Markdown string |

License

MIT