mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 10:11:47 +08:00
- 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
59 lines
1.2 KiB
Markdown
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 -->
|