diff --git a/code/frameworks/nextjs/src/types.ts b/code/frameworks/nextjs/src/types.ts index 2d9d0874b855..03dea988205b 100644 --- a/code/frameworks/nextjs/src/types.ts +++ b/code/frameworks/nextjs/src/types.ts @@ -19,7 +19,6 @@ type BuilderName = CompatibleString<'@storybook/builder-webpack5'>; export type FrameworkOptions = ReactOptions & { nextConfigPath?: string; - image?: Partial; builder?: BuilderOptions; }; @@ -71,6 +70,9 @@ export interface NextJsParameters { /** Next.js router configuration */ router?: Partial; + + /** Next.js image props */ + image?: Partial; }; } diff --git a/docs/get-started/frameworks/nextjs.mdx b/docs/get-started/frameworks/nextjs.mdx index 208cfce1e302..c8a50e8fe472 100644 --- a/docs/get-started/frameworks/nextjs.mdx +++ b/docs/get-started/frameworks/nextjs.mdx @@ -967,9 +967,6 @@ export default { framework: { name: '@storybook/your-framework', options: { - image: { - loading: 'eager', - }, nextConfigPath: path.resolve(process.cwd(), 'next.config.js'), }, }, @@ -984,12 +981,6 @@ Type: `Record` Configure options for the [framework's builder](../../api/main-config/main-config-framework.mdx#optionsbuilder). For Next.js, available options can be found in the [Webpack builder docs](../../builders/webpack.mdx). -#### `image` - -Type: `object` - -Props to pass to every instance of `next/image`. See [next/image docs](https://nextjs.org/docs/pages/api-reference/components/image) for more details. - #### `nextConfigPath` Type: `string` @@ -1000,6 +991,12 @@ The absolute path to the `next.config.js` file. This is necessary if you have a This framework contributes the following [parameters](../../writing-stories/parameters.mdx) to Storybook, under the `nextjs` namespace: +#### `image` + +Type: `object` + +Props to pass to every instance of `next/image`. See [next/image docs](https://nextjs.org/docs/pages/api-reference/components/image) for more details. + #### `appDirectory` Type: `boolean` @@ -1044,4 +1041,3 @@ Type: ``` The router object that is passed to the `next/router` context. See [Next.js's router docs](https://nextjs.org/docs/pages/building-your-application/routing) for more details. -