docs/_snippets/main-config-stories-with-object.md
export default {
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, vue3-vite, etc.
framework: '@storybook/your-framework',
stories: [
{
// ๐ Sets the directory containing your stories
directory: '../packages/components',
// ๐ Storybook will load all files that match this glob
files: '*.stories.*',
// ๐ Used when generating automatic titles for your stories
titlePrefix: 'MyComponents',
},
],
};
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, vue3-vite, etc.
import type { StorybookConfig } from '@storybook/your-framework';
const config: StorybookConfig = {
framework: '@storybook/your-framework',
stories: [
{
// ๐ Sets the directory containing your stories
directory: '../packages/components',
// ๐ Storybook will load all files that match this glob
files: '*.stories.*',
// ๐ Used when generating automatic titles for your stories
titlePrefix: 'MyComponents',
},
],
};
export default config;
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
import { defineMain } from '@storybook/your-framework/node';
export default defineMain({
framework: '@storybook/your-framework',
stories: [
{
// ๐ Sets the directory containing your stories
directory: '../packages/components',
// ๐ Storybook will load all files that match this glob
files: '*.stories.*',
// ๐ Used when generating automatic titles for your stories
titlePrefix: 'MyComponents',
},
],
});
// Replace your-framework with the framework you are using (e.g., react-vite, nextjs, nextjs-vite)
import { defineMain } from '@storybook/your-framework/node';
export default defineMain({
framework: '@storybook/your-framework',
stories: [
{
// ๐ Sets the directory containing your stories
directory: '../packages/components',
// ๐ Storybook will load all files that match this glob
files: '*.stories.*',
// ๐ Used when generating automatic titles for your stories
titlePrefix: 'MyComponents',
},
],
});
import { defineMain } from '@storybook/vue3-vite/node';
export default defineMain({
framework: '@storybook/vue3-vite',
stories: [
{
// ๐ Sets the directory containing your stories
directory: '../packages/components',
// ๐ Storybook will load all files that match this glob
files: '*.stories.*',
// ๐ Used when generating automatic titles for your stories
titlePrefix: 'MyComponents',
},
],
});
import { defineMain } from '@storybook/vue3-vite/node';
export default defineMain({
framework: '@storybook/vue3-vite',
stories: [
{
// ๐ Sets the directory containing your stories
directory: '../packages/components',
// ๐ Storybook will load all files that match this glob
files: '*.stories.*',
// ๐ Used when generating automatic titles for your stories
titlePrefix: 'MyComponents',
},
],
});
import { defineMain } from '@storybook/angular/node';
export default defineMain({
framework: '@storybook/angular',
stories: [
{
// ๐ Sets the directory containing your stories
directory: '../packages/components',
// ๐ Storybook will load all files that match this glob
files: '*.stories.*',
// ๐ Used when generating automatic titles for your stories
titlePrefix: 'MyComponents',
},
],
});
import { defineMain } from '@storybook/web-components-vite/node';
export default defineMain({
framework: '@storybook/web-components-vite',
stories: [
{
// ๐ Sets the directory containing your stories
directory: '../packages/components',
// ๐ Storybook will load all files that match this glob
files: '*.stories.*',
// ๐ Used when generating automatic titles for your stories
titlePrefix: 'MyComponents',
},
],
});
import { defineMain } from '@storybook/web-components-vite/node';
export default defineMain({
framework: '@storybook/web-components-vite',
stories: [
{
// ๐ Sets the directory containing your stories
directory: '../packages/components',
// ๐ Storybook will load all files that match this glob
files: '*.stories.*',
// ๐ Used when generating automatic titles for your stories
titlePrefix: 'MyComponents',
},
],
});