To configure Happo for a React component library that already uses Storybook, install the happo development dependency, point Happo at your Storybook config directory in a root-level happo.config.ts, then run the Happo CLI locally and in CI. Current Happo documentation says the CLI adds its runtime to the Storybook package it builds, so the basic setup does not require a manual Storybook registration import.
Prerequisites and minimum setup
This configuration assumes your React library has a working Storybook app with stories that render the component states you want to compare. Storybook supplies those isolated examples; Happo captures them and compares the results against a baseline.
Install Happo
npm install --save-dev happo
# or: pnpm add --save-dev happo
# or: yarn add --dev happo
Configure the Storybook integration
Create happo.config.ts in the repository root:
import { defineConfig } from 'happo';
export default defineConfig({
integration: {
type: 'storybook',
configDir: '.storybook',
},
// Add other Happo settings here as needed.
});
.storybook is the documented default Storybook configuration directory. If yours is elsewhere, set configDir to its actual path. The current setup is documented in Happo’s Storybook integration guide.
Add a repeatable command
Add a script to the root package’s package.json so local runs and CI use the same entry point:
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
{
"scripts": {
"happo": "happo"
}
}
Run it with npm run happo, or the equivalent script command for pnpm or Yarn. The CLI builds the Storybook package and inserts its client runtime. You do not need import 'happo/storybook/register' for this basic current setup; Happo says manual registration was required before version 6.19.1. Check the installed version before applying older snippets. The import can still be used when you need helpers such as theme switching or forced screenshots.
Adjust the integration for your Storybook build
Most projects can start with the defaults. Change build options only when the repository’s actual Storybook configuration or output layout calls for it. Happo documents these options in its Storybook integration guide:
| Option | Purpose and default | When to change it |
|---|---|---|
configDir |
Storybook configuration directory; defaults to .storybook. |
When the project stores its Storybook configuration elsewhere. |
outputDir |
Compiled Storybook output directory; defaults to .out. |
When your build emits the package to a different directory. If using a prebuilt package, it must match that package’s directory. |
staticDir |
Comma-separated list of directories containing static assets. | When Storybook depends on assets served from custom directories. |
usePrebuiltPackage |
When true, tells Happo to use an existing package instead of building Storybook. |
When a prior step in your pipeline has already produced the Storybook package; align outputDir with its location. |
previewOnly |
Builds the preview without the Storybook manager UI; documented default is true. |
Set to false if you need the manager UI, such as when downloading built packages to browse locally. |
navigatePerStory |
Loads each story in a fresh page instead of navigating client-side. | Use it to isolate state that leaks between stories; it is slower. |
These options broadly correspond to Storybook’s build options. In a monorepo or custom builder pipeline, verify the configuration directory, static assets, and produced output path rather than assuming the defaults fit.
Optional Storybook preset and decorator
A Happo preset and decorator are not required to run the basic integration. Add them only if the team wants a Storybook panel for inspecting Happo parameters or using testing helpers inside Storybook. Check version-specific guidance before copying older decorator examples; Happo documents an earlier decorator behavior before 6.19.1.
Recommended Free Tools
Choose useful stories, themes, and browser coverage
Represent the states people actually use
Stories define what Happo can render. Prefer named, deterministic examples for meaningful public states, such as default, disabled, loading, error, an open menu, hover or focus, and long or localized content where relevant. Avoid making the snapshot suite a random collection of every possible combination: each extra variant adds work and can consume quota across browsers and runs.
Happo’s product information says interaction tests can drive a component into a state before capture. Use those tests to prepare a screenshot state, while keeping behavioral assertions distinct from visual comparison: a matching image does not establish that an interaction is functionally correct.
Exclude unsuitable or unstable stories
Set parameters.happo = false at story or file level to exclude examples that are unstable or not suitable for screenshots. This is preferable to silently allowing a known nondeterministic example to generate noise.
Capture theme variants deliberately
Happo documents a happo.themes story parameter, for example ['light', 'dark'], and a theme-switching helper available through happo/storybook/register. Configure the switcher to change the same theme inputs your production components use; otherwise a passing snapshot may not cover the real theme path.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
Select browsers and viewports for your users
Build a coverage matrix from the component states and themes that matter, responsive breakpoints that exercise different layouts, browsers your product supports, and the CI frequency your team can afford. Happo’s product page advertises rendering across Chrome, Firefox, Safari, Edge, and iOS Safari, but browser availability depends on plan. Confirm the currently available choices for your account on Happo’s pricing page before designing a matrix around a specific browser.
Run Happo in CI and maintain baselines
Run Happo for pull requests and for the main or default branch. PR runs compare changes against a baseline; main-branch runs keep that baseline current. Happo’s pricing FAQ says the CLI detects common CI providers including GitHub Actions, CircleCI, Travis CI, and Azure DevOps. Exact workflow YAML depends on the project and provider; use Happo’s CI documentation for provider-specific setup.
Use selective PR runs for large catalogs
For a large story catalog, --only and --skip can limit what gets freshly rendered by component or story file. Happo describes partial PR runs as rendering the selected stories and combining those fresh screenshots with matching baseline screenshots to produce a complete report. Excluded stories still appear in reports by comparison with baseline data; only newly rendered screenshots count toward quota. Deleted stories remain represented in comparison reports.
Selective runs depend on usable baseline data. If a baseline is pending, Happo may wait before finalizing the comparison. Unresolved or malformed story metadata can cause a fallback to a full run. Log the selected filter in CI so you can tell what the job intended to test, and keep main/default branch runs enabled to maintain the baseline.
Estimate snapshot use before expanding coverage
Happo defines one snapshot as one screenshot of one component variant in one browser. Its basic monthly estimate is:
component variants × browsers × Happo runs per month
Happo’s pricing page illustrates this with 50 components × 3 browsers × 100 runs per month = 15,000 snapshots per month. That is the vendor’s example, not a forecast for every team. Count the stories or variants actually rendered, browsers selected, and recurring CI runs, including reruns, to estimate your own usage.
Happo’s pricing page lists a free plan with 5,000 snapshots per month in Chrome, with no time limit or credit card. Its FAQ says a free account pauses at its quota until an upgrade or the next cycle, while paid overages are billed at the listed rate. Plan quotas, browser choices, and prices can change, so verify the current terms directly on the pricing page.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Troubleshoot common setup problems
| Symptom | Likely cause | What to check |
|---|---|---|
| Happo cannot find or build Storybook. | configDir points to the wrong place, or the expected build layout differs from the repository. |
Confirm the directory containing Storybook configuration and set configDir explicitly. Check the builder’s real output path and set outputDir accordingly. |
| Static files are missing in captured stories. | The build does not include the directories serving those assets. | Review the project’s static asset setup and configure staticDir with the relevant comma-separated directories. |
| A prebuilt-package run fails or uses the wrong output. | usePrebuiltPackage is enabled but outputDir does not match the package produced by the earlier pipeline step. |
Make the directory match exactly, or let Happo build Storybook by disabling prebuilt-package use. |
| A story appears in results despite being excluded from fresh capture. | Partial-run reports can include baseline comparisons for excluded stories. | Check whether the story has matching baseline data; distinguish report presence from a newly rendered screenshot. |
| A selective run unexpectedly becomes a full run. | Story metadata may be unresolved or malformed. | Check story identifiers and metadata, then inspect the CI log for the effective filter and run behavior. |
| Theme screenshots do not reflect production appearance. | The theme helper may not be changing the actual theme inputs used by the component. | Wire theme switching to the same provider, attributes, or variables used in production and verify the story state. |
| Older examples require a manual runtime import. | The guidance may predate Happo 6.19.1. | Check the installed Happo version and follow its current integration documentation before adding legacy registration or decorator code. |
Or skip the browser setup
If your goal is a screenshot of a web page rather than repeatable component-state comparisons in Happo, ScreenshotNeo offers a one-request screenshot API. It is not a replacement for Happo’s Storybook baseline workflow, but it can be useful for direct page captures:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for parameters and output options. Cookie banners, popups, and chat widgets are removed before capture; bot checks, blank pages, and failed loads are not billed. An MCP server lets AI agents use screenshot and PDF-capture tools. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo free.
Frequently Asked Questions
Does Happo replace Storybook for a React component library?
No. Storybook provides the isolated component stories; Happo renders and compares those examples against visual baselines.
Do I need to register Happo manually in Storybook?
Not for the basic integration in current documented versions: the CLI adds its runtime to the Storybook package it builds. Manual registration may be relevant for helpers or older setups.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




