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

dyui-react

v0.1.0

Published

Dynamic UI runtime for any LangGraph agent: render live, pluggable cards (incl. custom HTML) from agent-emitted UI events.

Downloads

255

Readme

dyui-react

The React runtime for DyUI — render live, pluggable UI cards emitted by any LangGraph agent. Zero runtime dependencies (React is a peer), themeable via CSS variables, and works in Next.js, Vite, or any React app.

Install

npm install dyui-react
import { useDyUIAgent, DyUISurface, createRegistry } from "dyui-react";
import "dyui-react/styles.css";

Use

function MyCard({ props }) {
  return <div>{props.expression} = {props.result}</div>;
}

export default function App() {
  // Add/override cards by `component` key; built-ins stay available.
  const registry = createRegistry({ calc_result: MyCard });

  const { cards, tokens, status, run, dismiss } = useDyUIAgent({
    url: "http://localhost:8008/dyui/stream",
  });

  return (
    <>
      <button onClick={() => run("what is 2+2")}>Ask</button>
      <DyUISurface cards={cards} registry={registry} onDismiss={dismiss} />
      <pre>{tokens}</pre>
    </>
  );
}

API

| Export | What it does | |---|---| | useDyUIAgent({ url, headers?, autoRunInput?, collectTokens? }) | Connects to the agent's SSE endpoint and returns { cards, bySurface, surfaces, tokens, status, error, run, stop, dismiss, reset }. | | <DyUISurface cards registry? onDismiss? empty? /> | Lays out a list of cards. | | <DyUICard card registry? onDismiss? bare? /> | Renders a single card (header + lifecycle body). | | createRegistry(overrides) | Merge custom components over the built-ins. | | defaultRegistry | The built-in cards map. | | streamAgent(opts, onFrame) | Low-level SSE-over-fetch client (no React). | | reducer, selectCards, … | The pure store, if you want your own state wiring. | | sanitizeHtml | The default sanitizer used by the html card. |

Built-in cards

text · markdown · table · stat · progress · list · keyvalue · json · alert · image · html (sanitized custom markup).

Card component contract

interface CardComponentProps<P> {
  card: DyUICardData;   // full card (id, status, title, accent, …)
  props: P;             // the emitted props
  status: CardStatus;   // "pending" | "active" | "done" | "error"
}

pending cards render a skeleton automatically; error cards render the error message. Your component only handles the resolved/active content.

Theming

Override CSS variables (--dyui-accent, --dyui-surface-bg, --dyui-border, --dyui-text, …) or target .dyui-* classes. Add class="dyui-light" on an ancestor for the light theme. Per-card accent set on the agent side maps to --dyui-accent.

Dev

npm install
npm run typecheck && npm run build && npm test