Join live session: Test your components in browser with Storybook Test
Docs
Storybook Docs

managerHead

Parent: main.js|ts configuration

Type: (head: string) => string

Programmatically adjust the manager's <head> of your Storybook. For example, load a custom font or add a script. Most often used by addon authors.

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

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

.storybook/main.ts
// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
import type { StorybookConfig } from '@storybook/your-framework';
 
const config: StorybookConfig = {
  framework: '@storybook/your-framework',
  stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
  managerHead: (head) => `
    ${head}
    <link rel="preload" href="/fonts/my-custom-manager-font.woff2" />
  `,
};
 
export default config;