docs/_snippets/main-config-preview.md
export default {
previewBody: (body) => `
${body}
${
process.env.ANALYTICS_ID ? '<script src="https://cdn.example.com/analytics.js"></script>' : ''
}
`,
};
// 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 = {
previewBody: (body) => `
${body}
${
process.env.ANALYTICS_ID ? '<script src="https://cdn.example.com/analytics.js"></script>' : ''
}
`,
};
export default config;
export default {
previewHead: (head) => `
${head}
<style>
html, body {
background: #827979;
}
</style>
`,
};
// 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 = {
previewHead: (head) => `
${head}
<style>
html, body {
background: #827979;
}
</style>
`,
};
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({
previewBody: (body) => `
${body}
${
process.env.ANALYTICS_ID ? '<script src="https://cdn.example.com/analytics.js"></script>' : ''
}
`,
});
// 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({
previewBody: (body) => `
${body}
${
process.env.ANALYTICS_ID ? '<script src="https://cdn.example.com/analytics.js"></script>' : ''
}
`,
});
// 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({
previewHead: (head) => `
${head}
<style>
html, body {
background: #827979;
}
</style>
`,
});
// 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({
previewHead: (head) => `
${head}
<style>
html, body {
background: #827979;
}
</style>
`,
});
import { defineMain } from '@storybook/vue3-vite/node';
export default defineMain({
previewHead: (head) => `
${head}
<style>
html, body {
background: #827979;
}
</style>
`,
});
import { defineMain } from '@storybook/vue3-vite/node';
export default defineMain({
previewHead: (head) => `
${head}
<style>
html, body {
background: #827979;
}
</style>
`,
});
import { defineMain } from '@storybook/angular/node';
export default defineMain({
previewBody: (body) => `
${body}
${
process.env.ANALYTICS_ID ? '<script src="https://cdn.example.com/analytics.js"></script>' : ''
}
`,
});
import { defineMain } from '@storybook/angular/node';
export default defineMain({
previewBody: (body) => `
${body}
${
process.env.ANALYTICS_ID ? '<script src="https://cdn.example.com/analytics.js"></script>' : ''
}
`,
});
import { defineMain } from '@storybook/angular/node';
export default defineMain({
previewHead: (head) => `
${head}
<style>
html, body {
background: #827979;
}
</style>
`,
});
import { defineMain } from '@storybook/angular/node';
export default defineMain({
previewHead: (head) => `
${head}
<style>
html, body {
background: #827979;
}
</style>
`,
});
import { defineMain } from '@storybook/web-components-vite/node';
export default defineMain({
previewBody: (body) => `
${body}
${
process.env.ANALYTICS_ID ? '<script src="https://cdn.example.com/analytics.js"></script>' : ''
}
`,
});
import { defineMain } from '@storybook/web-components-vite/node';
export default defineMain({
previewBody: (body) => `
${body}
${
process.env.ANALYTICS_ID ? '<script src="https://cdn.example.com/analytics.js"></script>' : ''
}
`,
});
import { defineMain } from '@storybook/web-components-vite/node';
export default defineMain({
previewHead: (head) => `
${head}
<style>
html, body {
background: #827979;
}
</style>
`,
});
import { defineMain } from '@storybook/web-components-vite/node';
export default defineMain({
previewHead: (head) => `
${head}
<style>
html, body {
background: #827979;
}
</style>
`,
});