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

@runtimed/components

v0.3.0

Published

React components for rendering notebook cell outputs

Readme

@runtimed/components

React components for rendering notebook cell outputs. This package provides a comprehensive set of output renderers for displaying code execution results, including rich multimedia formats, terminal output, AI tool interactions, and geographic data.

Installation

pnpm add @runtimed/components
# or
npm install @runtimed/components

Peer Dependencies: React 19+

Quick Start

import { SingleOutput, OutputsContainer } from "@runtimed/components";
import "@runtimed/components/styles.css";

function NotebookOutputs({ outputs }) {
  return (
    <OutputsContainer>
      {outputs.map((output) => (
        <SingleOutput key={output.id} output={output} />
      ))}
    </OutputsContainer>
  );
}

Components

Output Renderers

| Component | Description | | ------------------- | ----------------------------------------------------------------------- | | SingleOutput | Smart router that selects the appropriate renderer based on output type | | OutputsContainer | Wrapper for consistent output styling | | RichOutputContent | Renders multimedia content by MIME type |

Specific Renderers

| Component | MIME Types | | ------------------ | ------------------------------------------------------ | | PlainTextOutput | text/plain | | MarkdownRenderer | text/markdown - GFM, KaTeX math, syntax highlighting | | HtmlOutput | text/html | | JsonOutput | application/json - interactive tree view | | ImageOutput | image/png, image/jpeg, image/gif, image/webp | | SvgOutput | image/svg+xml | | AnsiOutput | Terminal output with ANSI color codes | | GeoJsonMapOutput | application/geo+json - MapLibre-powered maps |

AI Tool Components

| Component | Purpose | | ---------------------- | ------------------------------------------- | | AiToolCallOutput | Displays AI tool invocation details | | AiToolResultOutput | Renders tool execution results | | AiToolApprovalOutput | UI for human-in-the-loop approval workflows |

Iframe Integration

For sandboxed output rendering:

import { IframeReactApp, IframeOutput } from "@runtimed/components";

// Parent: embed outputs in an iframe
<IframeOutput outputs={cellOutputs} />

// Child iframe: render the app
<IframeReactApp />

Communication utilities:

import {
  useIframeCommsParent,
  useIframeCommsChild,
  sendToIframe,
  sendFromIframe,
} from "@runtimed/components";

UI Components

Basic UI building blocks:

import { Button, Card, Spinner } from "@runtimed/components";

<Button variant="outline" size="sm">Click me</Button>
<Spinner size="md" />

Utilities

import { cn, groupConsecutiveStreamOutputs } from "@runtimed/components";

// Merge Tailwind classes
cn("px-2 py-1", condition && "bg-blue-500");

// Group stdout/stderr streams for cleaner display
const grouped = groupConsecutiveStreamOutputs(outputs);

Styling

Import the CSS for proper styling:

import "@runtimed/components/styles.css";

The package uses Tailwind CSS v4. Components are designed to work in both light and dark themes.

Features

  • Lazy loading: Heavy components like MarkdownRenderer are dynamically imported
  • Error boundaries: Outputs gracefully handle rendering failures
  • Artifact support: Handles both inline data and artifact URLs for large outputs
  • Suspense-ready: Built-in loading states with SuspenseSpinner

Output Data Format

Components expect outputs conforming to @runtimed/schema types:

import type { OutputData, OutputType } from "@runtimed/components";

interface OutputData {
  id: string;
  outputType:
    | "multimedia_display"
    | "multimedia_result"
    | "terminal"
    | "markdown"
    | "error";
  data?: string | null;
  representations?: Record<string, MediaContainer>;
  streamName?: "stdout" | "stderr";
}

Development

# Build
pnpm build

# Watch mode
pnpm dev

# Type check
pnpm type-check

# Lint
pnpm lint

Demo

The package includes a demo page for testing all output types:

import { OutputTypesDemoPage } from "@runtimed/components";

<OutputTypesDemoPage iframeUri="localhost:8000" />;

License

MIT