Back to Storybook

Nextjs Remove Addons

docs/_snippets/nextjs-remove-addons.md

10.3.61.5 KB
Original Source
js
export default {
  // ...
  addons: [
    // ...
    // ๐Ÿ‘‡ These can both be removed
    // 'storybook-addon-next',
    // 'storybook-addon-next-router',
  ],
};
ts
// Replace your-framework with nextjs or nextjs-vite
import type { StorybookConfig } from '@storybook/your-framework';

const config: StorybookConfig = {
  // ...
  addons: [
    // ...
    // ๐Ÿ‘‡ These can both be removed
    // 'storybook-addon-next',
    // 'storybook-addon-next-router',
  ],
};

export default config;
ts
// Replace your-framework with nextjs or nextjs-vite
import { defineMain } from '@storybook/your-framework/node';

export default defineMain({
  // ...
  addons: [
    // ...
    // ๐Ÿ‘‡ These can both be removed
    // 'storybook-addon-next',
    // 'storybook-addon-next-router',
  ],
});
<!-- JS snippets still needed while providing both CSF 3 & Next -->
js
// Replace your-framework with nextjs or nextjs-vite
import { defineMain } from '@storybook/your-framework/node';

export default defineMain({
  // ...
  addons: [
    // ...
    // ๐Ÿ‘‡ These can both be removed
    // 'storybook-addon-next',
    // 'storybook-addon-next-router',
  ],
});