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

@generative-dom/lit

v0.1.0

Published

Official Lit wrapper for Generative DOM streaming markdown renderer — provides the <generative-dom-renderer> custom element

Readme

@generative-dom/lit

Official Lit wrapper for the Generative DOM streaming markdown renderer.

Exposes a single custom element — <generative-dom-renderer> — built on LitElement. Because the output is a native Custom Element, you can use it from any framework or vanilla HTML.

Lit is a peer dependency (lit >= 3). No other runtime deps.

Installation

pnpm add @generative-dom/lit @generative-dom/core lit
# plus whatever plugins you want, e.g.:
pnpm add @generative-dom/plugin-markdown-base @generative-dom/plugin-markdown-heading

Vanilla HTML

<generative-dom-renderer markdown="# hello"></generative-dom-renderer>

<script type="module">
  import '@generative-dom/lit';
  import { markdownBase } from '@generative-dom/plugin-markdown-base';
  import { markdownHeading } from '@generative-dom/plugin-markdown-heading';

  const el = document.querySelector('generative-dom-renderer');
  el.plugins = [markdownBase(), markdownHeading()];
</script>

From any framework

import '@generative-dom/lit';
import { markdownBase } from '@generative-dom/plugin-markdown-base';
import { markdownHeading } from '@generative-dom/plugin-markdown-heading';

const el = document.createElement('generative-dom-renderer');
el.plugins = [markdownBase(), markdownHeading()];
el.markdown = '# streamed';
document.body.appendChild(el);

Properties & attributes

| Property | Attribute | Type | Notes | | ------------ | -------------- | ----------------------------------- | --------------------------------------------------- | | markdown | markdown | string | Reflected from attribute. Triggers reset + re-feed. | | debounceMs | debounce-ms | number | Default 16 (~1 frame). | | plugins | (no attr) | GenerativeDomPlugin[] | JS-only. Changing it recreates the Generative DOM instance. | | onGenerativeDomError | (no attr) | (err: GenerativeDomError) => void | Forwarded to Generative DOM's onError. |

Events

The element dispatches a bubbling generative-dom-event CustomEvent for each plugin event. The event detail is:

interface GenerativeDomEventDetail { name: string; data: unknown }
document.querySelector('generative-dom-renderer').addEventListener('generative-dom-event', (e) => {
  console.log(e.detail.name, e.detail.data);
});

Light DOM vs shadow DOM

GenerativeDomRendererElement renders into the light DOM (it overrides createRenderRoot() to return this). That is intentional — Generative DOM plugins render headings, code, links, and custom elements that need to be styleable by the page's global CSS. Encapsulating them inside a shadow root would hide them from page stylesheets and break any plugin that relies on global styling (e.g. .hl-* syntax highlight tokens, .prose class, user-supplied typography).

If you need style isolation, wrap <generative-dom-renderer> in your own shadow-hosting element.

Why a wrapper?

@generative-dom/core is framework-agnostic and does not depend on Lit. The wrapper exists so consumers can use Generative DOM as a drop-in custom element and pass plugins as a JS property, with proper lifecycle management (reactive updates, teardown on disconnect).

License

MIT