mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-01 05:05:25 +08:00
added code example to addon docs
This commit is contained in:
parent
5d14bc6b1c
commit
2644b6a111
@ -56,4 +56,24 @@ Then you'll be able to see those notes when you are viewing the story.
|
||||
|
||||

|
||||
|
||||
## Global Configuration
|
||||
Sometimes you might want to configure an addon globally, as in the case of collocating stories with components, or just simply to keep your stories file cleaner. To do that, you can add your decorators to a config file, typically in `.storybook/config.js`. Here's an example of how you might do that.
|
||||
|
||||
```js
|
||||
import { configure, addDecorator } from '@storybook/react';
|
||||
import { withOptions } from '@storybook/addon-options';
|
||||
|
||||
addDecorator(
|
||||
withOptions({
|
||||
name: 'CRA Kitchen Sink',
|
||||
goFullScreen: false,
|
||||
showAddonsPanel: true,
|
||||
showSearchBox: false
|
||||
// more configuration here
|
||||
})
|
||||
);
|
||||
```
|
||||
|
||||
Here's an example of a [production-ready config file](https://github.com/storybooks/storybook/blob/next/examples/cra-kitchen-sink/.storybook/config.js) from the cra-kitchen example.
|
||||
|
||||
Just like this, you can install any other addon and use it. Have a look at our [addon gallery](/addons/addon-gallery) to discover more addons.
|
||||
|
Loading…
x
Reference in New Issue
Block a user