storybook/docs/api/main-config-refs.md
Kyle Gach 1d3262ee62 Address comments:
- Add `babelDefault` and `managerHead` pages
- Fix broken links
- Clarify when some properties are primarily used by addon authors
- Document simplified options for `babel`, `babelDefault`, `viteFinal`, and `webpackFinal`
- Add description for `core.channelOptions`
- Remove the `previewMainTemplate` page
- Document possible shortcomings of some `stories` configurations
- Document limitations of some `typescript` options
2023-05-23 14:15:53 -06:00

59 lines
1.2 KiB
Markdown

---
title: 'refs'
---
Parent: [main.js|ts configuration](./main-config.md)
Type:
```ts
{ [key: string]:
| { title: string; url: string; expanded?: boolean }
| (config: { title: string; url: string; expanded?: boolean }) => { title: string; url: string; expanded?: boolean }
| { disable: boolean }
}
```
Configures [Storybook composition](../sharing/storybook-composition.md).
<!-- prettier-ignore-start -->
<CodeSnippets
paths={[
'common/main-config-refs.js.mdx',
'common/main-config-refs.ts.mdx',
]}
/>
<!-- prettier-ignore-end -->
## Using a function
You can use a function to dynamically configure refs:
<!-- prettier-ignore-start -->
<CodeSnippets
paths={[
'common/main-config-refs-with-function.js.mdx',
'common/main-config-refs-with-function.ts.mdx',
]}
/>
<!-- prettier-ignore-end -->
## Disable a ref
Some package dependencies automatically [compose their Storybook in yours](../sharing/package-composition.md). You can disable this behavior by setting `disable` to `true` for the package name:
<!-- prettier-ignore-start -->
<CodeSnippets
paths={[
'common/main-config-refs-disable.js.mdx',
'common/main-config-refs-disable.ts.mdx',
]}
/>
<!-- prettier-ignore-end -->