--- title: 'previewBody' sidebar: order: 16 title: previewBody --- Parent: [main.js|ts configuration](./main-config.mdx) Type: `(body: string) => string` Programmatically adjust the [preview ``](../../configure/story-rendering.mdx#adding-to-body) of your Storybook. Most often used by [addon authors](../../addons/writing-presets.mdx#ui-configuration). If you don't need to programmatically adjust the preview body, you can add scripts and styles to [`preview-body.html`](../../configure/story-rendering.mdx#adding-to-body) instead. For example, you can conditionally add scripts or styles, depending on the environment: {/* prettier-ignore-start */} {/* prettier-ignore-end */}