From your Next.js project root, run npm create storybook@latest and follow the setup prompts. For most new projects, Storybook recommends its Vite-based @storybook/nextjs-vite framework; keep the Webpack-based @storybook/nextjs option when your project depends on custom Webpack/Babel configuration or a Webpack-specific feature. Then create or select a Chromatic project, add its CLI to your development dependencies, and publish a first build to establish visual baselines.
Before you start
- Work from the root of the Next.js repository, where its package manifest is located.
- Check the live Storybook Next.js installation guidance for current compatibility. The official installation information retrieved on October 3, 2026 lists Next.js 14+ and Node.js 20+ among its requirements; these version requirements can change.
- Have access to a Chromatic account so you can create or select a project and obtain its project token.
Install Storybook in the Next.js project
- Open a terminal at the project root.
- Run
npm create storybook@latest. - Answer the CLI prompts and let it inspect the project dependencies to choose a configuration. Review the generated files and scripts before committing them.
- Start Storybook using the script the CLI adds to your package manifest, commonly
npm run storybook. Confirm your stories render locally before connecting Chromatic.
The exact generated configuration and script names can vary by Storybook release and package manager. If Storybook is already installed, use the current upgrade and migration instructions instead of copying an older major-version setup; older projects may contain legacy Next.js addons that current framework guidance says are redundant.
As an Amazon Associate I earn from qualifying purchases.
Choose the Next.js framework: Vite or Webpack
| Framework | Choose it when | Trade-off |
|---|---|---|
@storybook/nextjs-vite |
You are starting a typical new Next.js Storybook setup and do not need a Webpack-only feature. | Storybook recommends it for most projects, citing faster builds and development startup, modern test support, and simpler configuration. |
@storybook/nextjs |
Your project relies on custom Webpack or Babel configuration that cannot move to Vite, or requires specific Webpack functionality. | Retains a Webpack-based integration where compatibility matters more than moving to the Vite-based setup. |
Use the framework the CLI selects unless your project’s configuration gives you a concrete reason to choose differently. Verify framework support against the current documentation for the Storybook and Next.js versions actually installed.
Resolve common Next.js story behavior
Stories that use next/navigation
If a story imports next/navigation, it may need the app-directory setting. Add nextjs.appDirectory: true to that story’s parameters, or set it globally in the preview configuration if the application uses only the app directory. Follow the framework’s current Next.js documentation for the configuration shape supported by your installed release.
#1 Best Overall
Google Fonts fail during a build
A Storybook build can fail when it tries to fetch Google Fonts from an environment without reliable external network access. Storybook’s Next.js guidance recommends mocking those font requests through its documented environment-variable mechanism when they cause a failure. This is a targeted workaround, not a setting every project needs.
Other Next.js integrations
The selected framework supports Next.js-related behavior for features such as images, routing and navigation, fonts, styling, and absolute imports. Exact behavior depends on the framework and release, so consult the current framework page rather than assuming a setting from an older guide still applies.
Rank #2
- HTML CSS Design and Build Web Sites
- Comes with secure packaging
- It can be a gift option
Connect the project to Chromatic and publish the first build
- Create a Chromatic project or select one associated with your Storybook.
- Install the CLI as a development dependency:
npm install --save-dev chromatic. - Run the first publish from the repository root, replacing the example with your real project token:
npx chromatic --project-token=<your-project-token>. - Review the build in Chromatic. Its CLI builds and uploads Storybook to Chromatic’s cloud service and starts the publish and visual-test workflow.
- Treat snapshots from the first successful build as the initial visual baselines. Later builds compare new snapshots with those baselines; review changes and update baselines when the UI change is intentional.
Keep the project token private. For local testing, avoid committing it in source or shell scripts that will be checked in. In continuous integration, provide it through the CI provider’s secret store as CHROMATIC_PROJECT_TOKEN. Chromatic documents that environment variable for authentication.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Run Chromatic in GitHub Actions
Add the token under your GitHub repository’s Actions secrets, using the name CHROMATIC_PROJECT_TOKEN. A minimal workflow has this shape; replace the version placeholders with action versions compatible with your repository and choose deliberately whether to pin to an exact version, a major version, or a moving latest tag.
Rank #3
name: Chromatic
on: push
jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@<chosen-version>
with:
fetch-depth: 0
- uses: actions/setup-node@<chosen-version>
with:
node-version: <project-supported-version>
- run: npm ci
- uses: chromaui/action@<chosen-version>
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
Full Git history is included because Chromatic’s documented GitHub Actions pattern checks out the repository with fetch-depth: 0. If the project uses a package manager other than npm, replace npm ci with its lockfile-respecting install command. Pinning an exact action version makes updates explicit; a moving tag can pick up changes without editing the workflow, so it requires a different update policy. Consult the Chromatic GitHub Actions guide for its current action syntax and version-tag options.
Troubleshoot setup and build failures
Storybook’s local build fails before upload
First run the local Storybook start or build command and inspect its output. A broken story, project-specific configuration, or unavailable external resource can fail before Chromatic receives an upload; do not assume every failure originates in Chromatic.
Rank #4
- Brand: Wiley
- Set of 2 Volumes
- A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers
The build fails while fetching a font
If the logs point to Google Fonts and the build environment cannot reach the font service, apply Storybook’s documented environment-variable mock for those requests. Do not add the mock when fonts already load successfully.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchA story using app-router navigation does not render correctly
For stories importing next/navigation, check whether nextjs.appDirectory: true is needed. Configure it on the story or globally when the application uses only the app directory.
Best Value
Chromatic rejects authentication or cannot find the project
Confirm that the token belongs to the intended Chromatic project and is passed to the CLI or action without being truncated. In GitHub Actions, verify the repository secret name matches CHROMATIC_PROJECT_TOKEN and that the workflow references ${{ secrets.CHROMATIC_PROJECT_TOKEN }}.
A visual change appears in the review
A snapshot difference is a comparison result, not an automatic diagnosis that the change is a defect. Inspect the affected story and decide whether the UI change is intended; update the baseline for intentional changes using the review workflow.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
If you need screenshots of web pages rather than hosted component stories and visual review, ScreenshotNeo offers a website screenshot API and MCP server. For example, its one-call request can return a screenshot:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchescurl -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 request options. It accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, with verdict and billing details in response headers. Its MCP server gives AI agents tools for screenshots, page information, and PDF capture. The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.
Sign up for ScreenshotNeo free: 1,000 screenshots a month, no card required.
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.




