Gathering detailed insights and metrics for storybook-addon-next-router
Gathering detailed insights and metrics for storybook-addon-next-router
Gathering detailed insights and metrics for storybook-addon-next-router
Gathering detailed insights and metrics for storybook-addon-next-router
npm install storybook-addon-next-router
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (95.64%)
JavaScript (2.34%)
Shell (2.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
109 Stars
92 Commits
21 Forks
3 Watchers
2 Branches
15 Contributors
Updated on Jan 07, 2025
Latest Version
4.0.2
Package Id
storybook-addon-next-router@4.0.2
Unpacked Size
14.18 kB
Size
4.81 kB
File Count
19
NPM Version
8.19.2
Node Version
16.18.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
Use Next.js Router in your Storybook stories.
Note: these docs refer to 3.0
Add the addon to your configuration in .storybook/main.js
1module.exports = { 2 ...config, 3 addons: [ 4 ...your addons 5 "storybook-addon-next-router", 6 ], 7};
Add the RouterContext.Provider to .storybook/preview.js
1import { RouterContext } from "next/dist/shared/lib/router-context"; // next 12 2// import { RouterContext } from "next/dist/shared/lib/router-context"; // next 11.1 3// import { RouterContext } from "next/dist/next-server/lib/router-context"; // next < 11.1 4 5export const parameters = { 6 nextRouter: { 7 Provider: RouterContext.Provider, 8 }, 9}
1import MyComponentThatHasANextLink from "../component-that-has-a-next-link"; 2 3export default { 4 title: "My Story", 5}; 6 7// if you have the actions addon 8// you can click the links and see the route change events there 9export const Example = () => <MyComponentThatHasANextLink />; 10 11Example.parameters = { 12 nextRouter: { 13 path: "/profile/[id]", 14 asPath: "/profile/lifeiscontent", 15 query: { 16 id: "lifeiscontent", 17 }, 18 }, 19};
in preview.js
1export const parameters = { 2 nextRouter: { 3 path: '/', // defaults to `/` 4 asPath: '/', // defaults to `/` 5 query: {}, // defaults to `{}` 6 push() { 7 } // defaults to using addon actions integration, 8 // can override any method in the router 9 } 10}; 11
Read more about the options available for next/router at https://nextjs.org/docs/api-reference/next/router
To see real world usage of how to use this addon, check out the example app:
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
Found 7/20 approved changesets -- score normalized to 3
Reason
project is archived
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
17 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More