component-screenshot

Capture Storybook story screenshots as PNG assets by story-id.

1|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/gihwan-dev/claude-code-gui --skill component-screenshot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: component-screenshot
Source: https://github.com/gihwan-dev/claude-code-gui/tree/main/.claude/skills/component-screenshot
Command: npx skills add https://github.com/gihwan-dev/claude-code-gui --skill component-screenshot

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @playwright/test, express, and includes scripts (resource) components.

What problem does it solve?

Streamline UI validation by automatically generating consistent screenshots from Storybook stories, reducing manual screenshot effort and ensuring reliable visual references.

Core Features & Use Cases

  • Automated Storybook Screenshot: generate PNG previews from individual stories by story-id.
  • Configurable Viewport & Scale: supports width, height, and device-scale factors to match design specs.
  • End-to-end Workflow: builds static Storybook, serves it locally, and captures targeted components for design reviews or visual regression tests.

Quick Start

Run the capture script with a story-id and an output path to generate a screenshot.

Frequently Asked Questions about component-screenshot

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate capturing Storybook story screenshots for visual regression testing?

You can automate capturing Storybook screenshots by targeting individual story-ids to generate PNG assets. This process uses Playwright to render components from a local static Storybook build and save them as visual references for regression testing.

Can I configure viewport width and scale for Storybook component screenshots?

Yes, you can configure viewport width, height, and device-scale factors for Storybook component screenshots. This allows you to match exact design specs and ensure consistent visual QA across different viewport configurations.

Do I need to build Storybook before generating component previews?

Yes, you must run a local Storybook build (like pnpm build-storybook) and use a static server before capturing screenshots. The automation relies on this static environment to render and save targeted component previews as PNG assets.

What is the best way to generate PNG assets from Storybook stories by story-id?

The best way to generate PNG assets from Storybook stories is to use an automated Playwright script that targets stories by story-id. This end-to-end workflow builds, serves, and captures components for reliable design reviews.

Why does my Storybook screenshot automation require a static server?

Storybook screenshot automation requires a static server because it needs a locally hosted environment to render the built static Storybook files. Playwright then accesses these served pages to capture and save targeted component screenshots accurately.

Does this screenshot tool work for UI documentation and design review workflows?

Yes, this screenshot tool works for UI documentation and design review workflows. By capturing consistent PNG previews from Storybook stories by story-id, it reduces manual effort and provides reliable visual references for component validation.