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

@aklinker1/viteshot

v0.4.4

Published

Generate store screenshots and promo images with code, powered by Vite

Readme

ViteShot

NPM Version Docs

Generate store screenshots and promo images with code, powered by Vite.

Why?

With AI, it's common for developers with less design experience to generate store screenshots and promo images. However, one shot image generation models aren't very good at this yet.

However, AI is really good at building simple UIs with HTML! ViteShot provides a simple way for agents in your preferred dev environment to create and export images in a structured, easy-to-iterate way.

Get Started

  1. Add Vite and ViteShot as dev dependencies to your project:

    bun add -D @aklinker1/viteshot vite
  2. Initialize the ./store directory:

    bun viteshot init store
  3. Add the following scripts to your package.json:

    {
      "scripts": {
        "store:dev": "viteshot dev store",
        "store:export": "viteshot export store",
      }
    }

Then export your screenshots with bun store:export! Screenshots will be output to store/exports.

Design Files

Your screenshot designs go in store/designs/{name}@{width}x{height}.{ext}.

  • {name}: The name of your screenshot, it can be anything (ex: "small-marquee", "screenshot-1", etc).
  • {width}x{height}: The size your screenshot should be rendered at (ex: "1280x600", "640x400").
  • {ext}: ViteShot supports a variety of file extensions, so you can build your designs using your preferred frontend framework!

HTML

  1. Define an HTML fragment, this will be added to the body element automatically.
  2. Translations can be accessed using the handlebars syntax
<!-- designs/[email protected]>
<p>{{path.to.message}}</p>

[!NOTE]

You don't need a frontend framework to build a simple static layout. Using HTML design files is recommended.

Vue

  1. Add @vitejs/plugin-vue to store/viteshot.config.ts
  2. Use the t prop to access translations for the current locale
<!-- store/designs/[email protected] -->
<script lang="ts" setup>
import "../assets/tailwind.css";

defineProps<{
  t: Record<string, any>;
}>();
</script>

<template>
  <p>{{ t.path.to.message }}</p>
</template>

Svelte

  1. Add @sveltejs/vite-plugin-svelte to store/viteshot.config.ts
  2. Use the t prop to access translations for the current locale
<!-- store/designs/[email protected] -->
<script lang="ts">
  export let t: Record<string, any>
</script>

<p>{t.path.to.message}</p>

React

  1. Add @vitejs/plugin-react to store/viteshot.config.ts
  2. You're component must be the default export
  3. Use the t prop to access translations for the current locale
// store/designs/[email protected]
import React from "react";
import "../assets/tailwind.css";

export default function (props: { t: Record<string, any> }) {
  return <p>{t.path.to.message}</p>;
}

Styling

There are a few ways of adding CSS to your screenshots:

  1. Add global, shared CSS to your viteshot.config.ts file:

    import { defineConfig } from "@aklinker1/viteshot";
    
    export default defineConfig({
      screenshots: {
        css: ["assets/tailwind.css"], // Supports SCSS, SASS, etc
      },
    });
  2. Import your CSS files from inside your design file

    import "../assets/tailwind.css";
    
    export default function () {
      return <div>...</div>;
    }
  3. Use inline <style> blocks

    <style>
      ...
    </style>
    
    <div>...</div>

| Method | HTML | Vue | Svelte | React | | ---------------- | :--: | :-: | :----: | :---: | | Add css config | ✅ | ✅ | ✅ | ✅ | | Import CSS file | ❌ | ✅ | ✅ | ✅ | | Inline <style> | ✅ | ✅ | ✅ | ❌ |

Assets

Vite allows you to put assets in two folders:

  1. assets/
  2. public/

For HTML designs, you need to put files in public/, but for the other supported frameworks, you can use assets/ and import them into your design file.

| Method | HTML | Vue | Svelte | React | | --------- | :--: | :-: | :----: | :---: | | assets/ | ❌ | ✅ | ✅ | ✅ | | public/` | ✅ | ✅ | ✅ | ✅ |

Review Vite's docs for how to import or use assets from each directory.