Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To configure Happo for a React component library that already has Storybook, install the happo development dependency, point a root-level happo.config.ts at the Storybook configuration directory, then run the Happo CLI. Current Happo documentation says the CLI adds its client runtime to the Storybook package it builds, so the basic setup does not require a manual Storybook registration import. This guide covers the setup, CI, coverage choices, quota planning, and common problems.

What you need before configuring Happo

This setup assumes your React component library has a working Storybook app and stories that render the components you want to compare. Storybook provides isolated component examples; Happo captures those examples and compares them with a baseline. The exact commands below use npm, but equivalent package-manager commands are included.

  • A React component library with Storybook configured and runnable.
  • At least one story for the components you want to include.
  • A Happo account and the credentials required by your Happo project when you run captures. Consult the current Happo Storybook documentation for account and CI setup details.

Install Happo and add the minimum configuration

  1. Install Happo as a development dependency:

    npm install --save-dev happo
    # or: pnpm add --save-dev happo
    # or: yarn add --dev happo
  2. At the project root, create happo.config.ts. The default Storybook configuration directory is .storybook; change it if your repository uses a different path.

    import { defineConfig } from 'happo';
    
    export default defineConfig({
      integration: {
        type: 'storybook',
        configDir: '.storybook',
      },
      // Add other Happo settings here as needed.
    });
  3. Add a script to the root package.json so that local and CI runs share the same command:

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    #1 Best Overall
    Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
    • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
    • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
    • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
    • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
    • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
    {
      "scripts": {
        "happo": "happo"
      }
    }
  4. Run the integration:

    npm run happo

    Use pnpm happo or yarn happo if that is how your project invokes package scripts. The Happo CLI builds the Storybook package and captures its eligible stories.

Do you need to register the Happo runtime manually?

Not for the basic current setup: Happo says its CLI inserts the client runtime into the Storybook package it builds. Older instructions may show import 'happo/storybook/register'; Happo documentation says manual registration was required before version 6.19.1. Check your installed version before carrying over older snippets. The import can still be useful for optional helpers such as theme switching or forced screenshots.

When to add the Happo Storybook preset or decorator

The preset and decorator are optional. Add them when you want to inspect Happo parameters or use its testing helpers inside Storybook. They are not prerequisites for the minimum CLI integration, and older decorator examples may reflect behavior that predates Happo 6.19.1. Follow the current instructions for your installed version rather than adding a legacy setup by default.

Adjust the Storybook build integration when needed

The default paths work for a conventional Storybook project. For a monorepo, custom builder, or existing build pipeline, verify the directory Storybook actually uses and the output it actually produces before changing Happo settings. The integration options documented by Happo include:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Option Purpose and guidance
configDir Storybook configuration folder; defaults to .storybook.
outputDir Compiled output folder; defaults to .out. Set it to the output directory your build uses when the default is not correct.
staticDir Comma-separated list of directories containing static assets.
usePrebuiltPackage Set to true to skip the Storybook build and use an existing package. Ensure outputDir points to that package.
previewOnly Build only the preview, without the Storybook manager UI. The documented default is true; set it to false if you need to download built packages to browse locally.
navigatePerStory Load each story in a fresh page instead of navigating client-side. This is slower, but can help isolate state that leaks between stories.

Most options align with Storybook’s build-storybook options, according to the Happo integration guide. Treat the guide as the reference for exact configuration syntax if your builder or Storybook version differs from the baseline shown here.

Run Happo in CI and maintain a useful baseline

Run Happo on pull requests to catch changes and on your main or default branch to keep baseline screenshots current. Happo’s pricing FAQ says its CLI automatically detects common CI providers, including GitHub Actions, CircleCI, Travis CI, and Azure DevOps; use its CI documentation for provider-specific environment setup. The exact workflow file depends on your repository, package manager, credentials, and build configuration.

Use partial runs for large story catalogs

Happo’s --only and --skip options can limit which components or story files are freshly rendered. For a partial pull-request run, Happo describes finding a recent baseline from Git history, rendering the included stories, and combining new screenshots with matching baseline screenshots for a complete report. Keep both pull-request and main/default-branch runs configured: without a usable baseline, selective comparisons may not behave as intended. A pending baseline can delay the final comparison, and unresolved or malformed story metadata can cause a fallback to a full run. Log the filter used in CI so you can diagnose what the run covered.

Deleted stories remain represented in comparison reports. When a story is excluded with parameters.happo = false, either at story level or file level, it is not newly captured. With --only or --skip, excluded stories can still appear in the report using baseline data; only newly rendered screenshots count toward quota.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Choose stories, themes, and browser coverage deliberately

Prioritize meaningful component states

Do not aim for the largest story count. Include named stories for states where a visual regression would matter to consumers of the library. Depending on the component, that may mean default, disabled, loading, error, open-menu, hover or focus, and long or localized content. Stories should make the state reproducible rather than depend on incidental data or timing.

Happo’s product description says interaction tests can drive a component into a state before screenshot capture. Use behavior assertions and visual comparison as complementary checks: a visual diff shows rendered change, while an interaction test checks behavior.

Capture theme variants

Happo documents a happo.themes story parameter, for example ['light', 'dark'], and a theme-switching helper available through happo/storybook/register. Ensure the switcher changes the same theme inputs used by the production component; otherwise the captured variants may not reflect real theme behavior.

Balance browsers and viewports against product needs

Choose a matrix based on the component states and themes that matter, responsive breakpoints that exercise layout changes, and the browsers your users need. Happo’s product page advertises rendering across Chrome, Firefox, Safari, Edge, and iOS Safari, but which browsers are included depends on the plan. Check the current Happo pricing page before relying on a specific browser entitlement. Happo also describes accessibility checks alongside screenshot testing; an accessibility finding and a visual diff answer different questions, so neither replaces the other.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Estimate snapshot use before expanding the matrix

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

For illustration, Happo’s pricing page gives the example 50 components × 3 browsers × 100 monthly runs = 15,000 snapshots per month. That is a vendor example, not a prediction of what a particular team will use. Count your included stories or variants, browsers, routine CI runs, and likely reruns.

The pricing page lists a free plan with 5,000 snapshots per month in Chrome, with no time limit or credit card. It also lists paid plans with larger quotas and browser choices. Happo’s FAQ says a free account at quota is paused until an upgrade or the next cycle, while paid overages are billed at the listed rate. Pricing, quotas, and browser entitlements can change, so confirm current terms directly on the pricing page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Troubleshoot common setup and coverage problems

Symptom Likely cause What to check or change
Happo cannot find the Storybook configuration or build configDir or output path does not match the repository’s actual layout. Check where the Storybook configuration lives; set configDir accordingly. For a custom or prebuilt package, align outputDir with the directory actually produced or supplied.
An older example asks for manual runtime registration The instruction may target a Happo version before 6.19.1. Use the current integration docs for the installed version. Current CLI setup does not require the registration import for the basic flow.
A partial PR run turns into a full run or lacks a comparison The baseline may be missing, pending, or unusable; story metadata may be malformed. Ensure the main/default branch is also run, inspect metadata and filters, and log the selected --only or --skip values in CI.
Theme screenshots do not reflect the intended appearance The theme helper may not be changing the production theme inputs. Verify the story parameter and switcher update the same theme configuration the component uses in the application.
Snapshot use is higher than expected Every freshly rendered component variant in every browser contributes a snapshot; retries add runs. Recount eligible variants, browser targets, and CI reruns. Exclude genuinely unstable or irrelevant stories with parameters.happo = false, or narrow a PR run with supported story filters.
State appears to leak from one story to another Client-side navigation can preserve state between stories. Consider navigatePerStory to load each story in a fresh page, accepting slower runs in exchange for isolation.

Or skip the browser setup

If your immediate need is a website screenshot rather than a visual-regression baseline for Storybook stories, ScreenshotNeo offers a one-request screenshot API and an MCP server for AI agents. It is not a replacement for configuring Happo to compare a component library’s stories, but it can avoid maintaining browser-capture code for standalone page screenshots.

See the ScreenshotNeo API documentation. This cURL request captures Stripe as a WebP file; replace the URL with the page you need and provide your API key:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, and failed loads are not billed. Its MCP server gives AI agents screenshot tools, and the free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo’s free plan.

Frequently Asked Questions

Can Happo be used with React component libraries?

Yes. The documented Storybook integration captures eligible stories, so a React library can use its Storybook examples as visual comparison targets.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do I need a Storybook manager UI for Happo captures?

The documented previewOnly default is true, which builds the preview without the manager UI. Set it to false when you need the manager for browsing a downloaded build.

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.