Back to Storybook

Main Config Stories Only Mdx

docs/_snippets/main-config-stories-only-mdx.md

10.3.64.6 KB
Original Source
ts
// Replace your-framework with the framework you are using, e.g., nextjs-vite, vue3-vite, angular, sveltekit, etc.
import type { Preview } from '@storybook/your-framework';

const preview: Preview = {
  // ...
  // define at least one local story/page here
  stories: ['../Introduction.mdx'],
  // define composed Storybooks here
  refs: {
    firstProject: { title: 'First', url: 'some-url' },
    secondProject: { title: 'Second', url: 'other-url' },
  },
};

export default preview;
js
export default {
  // ...
  // define at least one local story/page here
  stories: ['../Introduction.mdx'],
  // define composed Storybooks here
  refs: {
    firstProject: { title: 'First', url: 'some-url' },
    secondProject: { title: 'Second', url: 'other-url' },
  },
};
ts
// Replace your-framework with the framework you are using, e.g., nextjs, nextjs-vite, react-vite, etc.
import { defineMain } from '@storybook/your-framework/node';

const config = defineMain({
  // ...
  // define at least one local story/page here
  stories: ['../Introduction.mdx'],
  // define composed Storybooks here
  refs: {
    firstProject: { title: 'First', url: 'some-url' },
    secondProject: { title: 'Second', url: 'other-url' },
  },
});

export default config;
<!-- JS snippets still needed while providing both CSF 3 & Next -->
js
// Replace your-framework with the framework you are using, e.g., nextjs, nextjs-vite, react-vite, etc.
import { defineMain } from '@storybook/your-framework/node';

const config = defineMain({
  // ...
  // define at least one local story/page here
  stories: ['../Introduction.mdx'],
  // define composed Storybooks here
  refs: {
    firstProject: { title: 'First', url: 'some-url' },
    secondProject: { title: 'Second', url: 'other-url' },
  },
});

export default config;
ts
import { defineMain } from '@storybook/vue3-vite/node';

const config = defineMain({
  // ...
  // define at least one local story/page here
  stories: ['../Introduction.mdx'],
  // define composed Storybooks here
  refs: {
    firstProject: { title: 'First', url: 'some-url' },
    secondProject: { title: 'Second', url: 'other-url' },
  },
});

export default config;
<!-- JS snippets still needed while providing both CSF 3 & Next -->
js
import { defineMain } from '@storybook/vue3-vite/node';

const config = defineMain({
  // ...
  // define at least one local story/page here
  stories: ['../Introduction.mdx'],
  // define composed Storybooks here
  refs: {
    firstProject: { title: 'First', url: 'some-url' },
    secondProject: { title: 'Second', url: 'other-url' },
  },
});

export default config;
ts
import { defineMain } from '@storybook/angular/node';

const config = defineMain({
  // ...
  // define at least one local story/page here
  stories: ['../Introduction.mdx'],
  // define composed Storybooks here
  refs: {
    firstProject: { title: 'First', url: 'some-url' },
    secondProject: { title: 'Second', url: 'other-url' },
  },
});

export default config;
ts
import { defineMain } from '@storybook/web-components-vite/node';

const config = defineMain({
  // ...
  // define at least one local story/page here
  stories: ['../Introduction.mdx'],
  // define composed Storybooks here
  refs: {
    firstProject: { title: 'First', url: 'some-url' },
    secondProject: { title: 'Second', url: 'other-url' },
  },
});

export default config;
<!-- JS snippets still needed while providing both CSF 3 & Next -->
js
import { defineMain } from '@storybook/web-components-vite/node';

const config = defineMain({
  // ...
  // define at least one local story/page here
  stories: ['../Introduction.mdx'],
  // define composed Storybooks here
  refs: {
    firstProject: { title: 'First', url: 'some-url' },
    secondProject: { title: 'Second', url: 'other-url' },
  },
});

export default config;