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

ai-screenshot

v0.1.0

Published

Generate React components or PNG/SVG images of SaaS app screenshots with AI-powered content generation

Readme

ai-screenshot

npm version License: MIT

Generate React components or PNG/SVG images of SaaS app screenshots with AI-powered content generation.

Features

  • Generate React components, PNG images, or SVG images
  • Support for sidebar and stacked layouts
  • Various content types (forms, tables, grids, charts, dashboards)
  • TypeScript interfaces for configuration
  • AI-powered content generation for missing properties

Installation

npm install ai-screenshot
# or
yarn add ai-screenshot
# or
pnpm add ai-screenshot

Usage

Basic Example

import { Screenshot } from 'ai-screenshot'

function App() {
  return (
    <Screenshot
      layout='sidebar'
      content={{
        menus: [
          { title: 'Dashboard', icon: 'home' },
          { title: 'Analytics', icon: 'chart' },
          { title: 'Settings', icon: 'gear' }
        ],
        tables: [
          {
            title: 'Recent Orders',
            columns: ['Order ID', 'Customer', 'Status', 'Amount'],
            // Rows will be AI-generated if not provided
          }
        ]
      }}
    />
  )
}

Export as Image

import { Screenshot } from 'ai-screenshot'

function App() {
  return (
    <Screenshot
      layout='stacked'
      content={{
        forms: [
          {
            title: 'User Registration',
            fields: [
              { label: 'Name', type: 'text' },
              { label: 'Email', type: 'email' }
            ]
          }
        ]
      }}
      exportFormat='png'
      onExport={(dataUrl) => {
        // Handle the exported image data URL
        console.log(dataUrl)
      }}
    />
  )
}

API Reference

<Screenshot> Component

The main component for generating screenshots.

Props

| Prop | Type | Description | |------|------|-------------| | layout | 'sidebar' \| 'stacked' | Layout type for the screenshot | | content | ContentConfig | Configuration for the content to display | | theme | ThemeConfig | Optional theme configuration | | exportFormat | 'react' \| 'png' \| 'svg' | Format to export the screenshot | | onExport | (data: string) => void | Callback when export is complete |

Types

interface ScreenshotOptions {
  layout: 'sidebar' | 'stacked'
  content: ContentConfig
  theme?: ThemeConfig
  exportFormat?: 'react' | 'png' | 'svg'
  onExport?: (data: string) => void
}

interface ContentConfig {
  menus?: MenuConfig[]
  forms?: FormConfig[]
  tables?: TableConfig[]
  charts?: ChartConfig[]
  dashboards?: DashboardConfig[]
}

interface MenuConfig {
  title: string
  icon?: string
  items?: MenuItem[]
}

interface FormConfig {
  title: string
  fields: FormField[]
}

interface TableConfig {
  title: string
  columns: string[]
  rows?: any[][]
}

interface ChartConfig {
  title: string
  type: 'bar' | 'line' | 'pie' | 'area'
  data?: any
}

interface DashboardConfig {
  title: string
  widgets: (TableConfig | ChartConfig | FormConfig)[]
}

Dependencies

  • ai-functions
  • ai-providers
  • html-to-image (for PNG/SVG export)
  • react
  • zod (for schema validation)