Skip to content

Commit 6815ee6

Browse files
SB README (#1905)
* Update README.md * Create gorgeous-falcons-talk.md
1 parent 1fa031f commit 6815ee6

File tree

2 files changed

+36
-16
lines changed

2 files changed

+36
-16
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@lg-tools/storybook': patch
3+
---
4+
5+
Updates README for storybook addon

tools/storybook/README.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
11
# `@lg-tools/storybook`
22

3-
Shared Storybook configuration for LeafyGreen repositories.
3+
Storybook addon to share configuration in LeafyGreen repositories.
44

5-
##
5+
## Usage
66

7-
Install this package, and consume it in your `.storybook` config files.
7+
Install this package, and consume it in your `.storybook/` config files.
88

9-
```js
9+
```ts
1010
// .storybook/main.ts
11-
12-
import main from '@lg-tools/storybook';
13-
export default main;
11+
export default {
12+
addons: ['@lg-tools/storybook'],
13+
framework: {
14+
name: '@storybook/react-webpack5',
15+
options: {
16+
fastRefresh: true,
17+
strictMode: true,
18+
},
19+
},
20+
};
1421
```
1522

16-
```js
17-
// .storybook/manager.js
18-
import { addons } from '@storybook/addons';
23+
Most parameters `preview.ts` will be automatically populated by the addon. However you may want to customize certain things like section ordering:
1924

20-
import theme from '@lg-tools/storybook/theme';
21-
22-
addons.setConfig({
23-
name: 'LeafyGreen UI',
24-
theme,
25-
});
25+
```js
26+
// .storybook/preview.js
27+
const parameters = {
28+
options: {
29+
storySort: {
30+
method: 'alphabetical',
31+
order: [
32+
// ... section headers
33+
],
34+
},
35+
},
36+
};
37+
38+
export default {
39+
parameters,
40+
};
2641
```

0 commit comments

Comments
 (0)