Back to Storybook

previewHead

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

10.3.6666 B
Original Source

Parent: main.js|ts configuration

Type: (head: string) => string

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

<Callout variant="info" icon="💡"> If you don't need to programmatically adjust the preview head, you can add scripts and styles to [`preview-head.html`](../../configure/story-rendering.mdx#adding-to-head) instead. </Callout>

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

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