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

gravity-artifacts

v0.2.7

Published

The physics-first code runner for React. Drop-in Claude Artifacts for any AI app.

Readme

🌌 Gravity Artifacts

The physics-first code runner for React. Drop-in Claude Artifacts for any AI app.

npm version GitHub stars License: MIT


✨ What is Gravity Artifacts?

Gravity Artifacts is a single React component that gives any AI chat application a beautiful, interactive code execution panel — just like Claude Artifacts, but open-source, customizable, and installable in seconds.

When your AI generates code (React, HTML, CSS, JavaScript), Gravity Artifacts automatically:

  • 🎯 Extracts code blocks from the AI's streaming response in real-time
  • Compiles TSX/JSX/HTML instantly in the browser (no server needed)
  • 🖥️ Renders the result in a secure, sandboxed iframe
  • 🌊 Animates the panel with physics-based spring animations (gravity, bounce, elasticity)

🚀 Quick Start

npm install gravity-artifacts
import { GravityArtifact } from 'gravity-artifacts';

function MyAIChat() {
  const [code, setCode] = useState('');

  return (
    <div className="flex h-screen">
      <ChatPanel onCodeGenerated={setCode} />
      <GravityArtifact 
        code={code} 
        theme="dark" 
        animation="spring"
      />
    </div>
  );
}

🎬 Demo

Live Playground →

📦 Features

  • 🧊 Zero Config — Works out of the box with any React app
  • 🔒 Secure Sandbox — All code runs in an isolated iframe (XSS-safe)
  • 🌊 Real-Time Visual Streaming — Renders and compiles code dynamically during LLM token streaming with automatic JSX tag recovery
  • 🚀 1-Click Deployments — Deploy the sandbox directly to Vercel or Netlify with a single click
  • 📦 Vite & StackBlitz Export — Export the workspace as a mountable Vite structure or open it instantly in StackBlitz with React/Vue/Svelte configurations
  • 🎨 CSS Variable Customizer — Float controls sidebar to adjust custom CSS variables and Tailwind themes instantly via secure postMessage tunnels
  • 🪲 Inline Monaco Diagnostics — Displays console logs, warnings, and compiler errors as visual underlines and editor decorations directly on the code lines
  • 📱 Premium Device Mockups — Immersive borders, cameras (Dynamic Island), and orientations for desktop, tablet, and mobile views
  • 🔍 Zoom Controls — Slider to zoom in/out of the rendered preview
  • 📋 Code Editor — Monaco Editor integration with full syntax highlighting, tabs, and multi-file editing
  • 🔄 Multi-Framework Support — Out-of-the-box support for React, Vue 3 (SFC), and Svelte 5
  • Shadcn/Tailwind Ready — Injects shadcn-compatible CSS variables and Tailwind color tokens into the sandbox iframe
  • Offline WASM Option — Pass wasmUrl to self-host esbuild.wasm when CDN access is unavailable
  • Asset Mapping — Pass assetMapper to resolve local image paths, with aesthetic placeholders for missing generated assets
  • IDE ShortcutsCtrl/Cmd+S and Ctrl/Cmd+Enter refresh the preview without triggering browser save
  • 🎛️ Console Panel — Live console.log/error output from the sandbox
  • 🧩 Framework Agnostic — Works with any AI backend (OpenAI, Anthropic, etc.)

📖 Documentation

| Document | Description | |----------|-------------| | Vision & Purpose | What this project is and why it exists | | Tech Stack | All technologies used and why | | Design System | Colors, typography, animations, tokens | | API Reference | Complete component props and methods | | Architecture Overview | How the system works internally | | Compiler Engine | How TSX compilation works in-browser | | Sandbox Security | iframe isolation and XSS protection | | Streaming Parser | How code is extracted from AI streams | | Component Tree | Visual component hierarchy | | Features Spec | Detailed feature specifications | | Props API Spec | Every prop, type, and default value | | Animations Spec | All animation definitions | | Themes Spec | Theme system and customization | | File Structure | Exact code file/folder layout | | Publishing Guide | How to build and publish to NPM | | Marketing Plan | Launch strategy for maximum visibility |

🛠️ Development

# Clone the repo
git clone https://github.com/gonzalomendez/gravity-artifacts.git

# Install dependencies
cd gravity-artifacts
pnpm install

# Start the development playground
pnpm dev

# Build the library
pnpm build

# Run tests
pnpm test

📄 License

MIT © Gonzalo Mendez