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

@zohaibarsalan/screenshotter

v0.2.0

Published

React package for in-app screenshot capture with direct browser downloads.

Downloads

175

Readme

@zohaibarsalan/screenshotter

In-app screenshot capture for React apps.

It runs in the browser, downloads captures directly, and does not require a separate capture service.

Status

Beta.

The package is usable for local product, UI, and QA workflows. Browser-only rendering still has known fidelity limits, but the install path, API, and current capture flow are ready for beta testing.

Install

pnpm add @zohaibarsalan/screenshotter

Quick Start

import {
  defineScreenshotterConfig,
  mountScreenshotter,
} from "@zohaibarsalan/screenshotter";

mountScreenshotter(
  defineScreenshotterConfig({
    enabled: true,
    project: "my-app",
  }),
);

Import that file once from your client entrypoint.

Framework Entrypoints

Use the same bootstrap code above, then import or render it once in the right client-side place:

| Framework | Recommended location | | --- | --- | | React + Vite | src/main.tsx imports src/screenshotter.ts | | React + CRA | src/index.tsx imports src/screenshotter.ts | | Next.js App Router | client component rendered from app/layout.tsx | | Next.js Pages Router | component rendered from pages/_app.tsx | | TanStack Router | src/main.tsx imports src/screenshotter.ts | | TanStack Start | root route/app shell client component | | Remix | app/entry.client.tsx imports app/screenshotter.client.ts | | Astro + React | React island with client:only="react" | | Gatsby | gatsby-browser.tsx wrapRootElement |

See the repository README for full framework-specific snippets.

Features

  • Floating launcher UI
  • Keyboard shortcut: Cmd/Ctrl + Shift + K
  • Capture modes: element, viewport, fullpage
  • Output formats: png, jpeg
  • Adjustable JPEG quality
  • Adjustable element padding
  • Optional current-theme or both-theme capture
  • Browser download output
  • Lazy html-to-image first with lazy html2canvas-pro fallback
  • Tree-shakeable package metadata

Exports

  • ScreenshotterWidget
  • mountScreenshotter(options)
  • defineScreenshotterConfig(config)
  • type ScreenshotterWidgetProps
  • type MountScreenshotterOptions
  • type CaptureMode
  • type CaptureFormat
  • type CapturePayload
  • type SaveResult
  • type ThemeSelection
  • type ThemeValue

Configuration

| Option | Type | Default | Description | | --- | --- | --- | --- | | enabled | boolean | NODE_ENV === "development" | Enables or disables Screenshotter. | | project | string | "app" | Project name included in capture metadata and file names. | | elementPaddingPx | number | 8 | Extra crop padding around element captures. | | captureSettleMs | number | 700 | Delay before capture so UI can settle. | | defaultMode | "element" \| "viewport" \| "fullpage" | "element" | Initial capture mode. | | themeSelectionDefault | "current" \| "both" | "current" | Initial theme capture behavior. | | themeAdapter | { getCurrentTheme; setTheme } | undefined | Required for both-theme capture. | | onSaved | (result) => void | undefined | Called after a successful browser download. | | onError | (message) => void | undefined | Called when capture fails. | | mountId | string | "screenshotter-root" | DOM id used by mountScreenshotter. |

Notes

  • Captures use DOM and Canvas APIs in the browser.
  • Element capture renders the viewport context first, then crops the selected element.
  • html-to-image is lazy-loaded on capture; html2canvas-pro is lazy-loaded only for fallback rendering.
  • No network transport is used by the current package.
  • Published builds omit source maps to keep the installed package smaller.
  • Cross-origin fonts/images, videos, iframes, canvas, and some advanced CSS can still differ from native screenshots.

Repository

  • Full docs: https://github.com/zohaibarsalan/screenshotter#readme
  • Issues: https://github.com/zohaibarsalan/screenshotter/issues

License

ISC