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/plugin-rich-table

v0.2.0

Published

Generative DOM plugin — rich interactive tables (sort, filter, paginate, expandable rows, typed columns)

Readme

@generative-dom/plugin-rich-table

Interactive rich-table plugin for Generative DOM. Recognizes fenced rich-table blocks in markdown and renders them as the <ce-rich-table> web component with sort, filter, pagination, sticky headers, expandable detail rows, and typed columns (text, num, date, badge, progress, link, inline md, code).

Syntax

```rich-table sort filter paginate=10 sticky-header max-height=400 row-height=compact
| id:num | name:text | status:badge | progress:progress | url:link | notes:md |
|--------|-----------|--------------|-------------------|----------|----------|
| 1 | Alpha | active | 0.62 | https://x/a | *hot* lead |
| 2 | Beta  | paused | 0.20 | https://x/b | on hold   |
> 1: Shipped Q1 2025. See **release notes**.
> 2: Re-open after compliance review.
```

Fence flags

| flag | meaning | |------------------|------------------------------------------------------------| | sort | Click a header to cycle asc → desc → none. | | filter | Inline <input> in each header narrows rows as you type. | | paginate=N | Page size (default 0 = no pagination). | | sticky-header | Pin the header row while the body scrolls. | | max-height=PX | Cap the scroll container height, enabling in-table scroll. | | row-height=... | compact / cozy (default) / comfortable. |

Column types (name:type)

text (default), num, date, badge, progress (0..1 rendered as bar

  • %), link (https URLs), md (inline markdown: **bold**, *em*, `code`, links), code (monospace verbatim).

Expandable detail rows

A line > N: … after the body attaches a detail block to 1-indexed row N. Multiple > N: lines concatenate. Inline markdown is supported. Rows with details get a chevron toggle.

Usage

import { GenerativeDom } from '@generative-dom/core';
import { richTable } from '@generative-dom/plugin-rich-table';

const md = new GenerativeDom({
  container: document.getElementById('out')!,
  plugins: [richTable() /* + others */],
});

The plugin's init() auto-registers <ce-rich-table> globally. If you want to use the web component without the plugin (e.g. inside a React app), import it directly:

import { registerRichTable } from '@generative-dom/plugin-rich-table';
registerRichTable();

Token shape

The plugin emits a rich-table token with this payload in meta:

interface RichTablePayload {
  columns: { name: string; type: ColumnType; align: 'left'|'center'|'right'|null }[];
  rows: { cells: string[]; detail?: string }[];
  options: {
    sort: boolean;
    filter: boolean;
    pageSize: number;
    maxHeight: number;
    stickyHeader: boolean;
    rowHeight: 'compact' | 'cozy' | 'comfortable';
  };
}

That payload is JSON-serialized into a <script type="application/json"> child of the <ce-rich-table> host. The web component reads it on connectedCallback and on any DOM mutation (so streaming updates that replace the script re-render the table).

Security

No innerHTML is used for user-derived values outside the Shadow DOM — only controlled, escaped templates inside the web component. Link types reject anything not prefixed with https:// or http://.