docs/_snippets/initialize-library-in-preview.md
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, vue3-vite, etc.
import type { Preview } from '@storybook/your-framework';
import { initialize } from '../lib/your-library';
initialize();
const preview: Preview = {
// ...
};
export default preview;
import { initialize } from '../lib/your-library';
initialize();
export default {
// ...
};
// Replace your-framework with the framework you are using, e.g. nextjs, nextjs-vite, react-vite, etc.
import { definePreview } from '@storybook/your-framework';
import { initialize } from '../lib/your-library';
initialize();
const preview = definePreview({
// ...
});
export default preview;
// Replace your-framework with the framework you are using, e.g. nextjs, nextjs-vite, react-vite, etc.
import { definePreview } from '@storybook/your-framework';
import { initialize } from '../lib/your-library';
initialize();
const preview = definePreview({
// ...
});
export default preview;
import { definePreview } from '@storybook/web-components-vite';
import { initialize } from '../lib/your-library';
initialize();
const preview = definePreview({
// ...
});
export default preview;
import { definePreview } from '@storybook/web-components-vite';
import { initialize } from '../lib/your-library';
initialize();
const preview = definePreview({
// ...
});
export default preview;