Back to Storybook

previewBody

docs/api/main-config/main-config-preview-body.mdx

10.3.6670 B
Original Source

Parent: main.js|ts configuration

Type: (body: string) => string

Programmatically adjust the preview <body> of your Storybook. Most often used by addon authors.

<Callout variant="info" icon="💡">

If you don't need to programmatically adjust the preview body, you can add scripts and styles to preview-body.html instead.

</Callout>

For example, you can conditionally add scripts or styles, depending on the environment:

<CodeSnippets path="main-config-preview-body.md" />