Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion code/frameworks/nextjs/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ type BuilderName = CompatibleString<'@storybook/builder-webpack5'>;

export type FrameworkOptions = ReactOptions & {
nextConfigPath?: string;
image?: Partial<NextImage.ImageProps>;
builder?: BuilderOptions;
};

Expand Down Expand Up @@ -71,6 +70,9 @@ export interface NextJsParameters {

/** Next.js router configuration */
router?: Partial<NextRouter>;

/** Next.js image props */
image?: Partial<NextImage.ImageProps>;
};
}

Expand Down
16 changes: 6 additions & 10 deletions docs/get-started/frameworks/nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -967,9 +967,6 @@ export default {
framework: {
name: '@storybook/your-framework',
options: {
image: {
loading: 'eager',
},
nextConfigPath: path.resolve(process.cwd(), 'next.config.js'),
},
},
Expand All @@ -984,12 +981,6 @@ Type: `Record<string, any>`

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`
Expand All @@ -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`
Expand Down Expand Up @@ -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.

Loading