-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstorybook.code-snippets
42 lines (42 loc) · 1.03 KB
/
storybook.code-snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
"stories.js": {
"scope": "javascript,javascriptreact",
"prefix": ["stories", "Story"],
"description": "Create a Storybook file",
"body": [
"import Component from '${1:.}';",
"import React from 'react';",
"",
"export default {",
" component: Component,$3",
"};",
"",
"export function ${2:${TM_FILENAME_BASE/\\.stories$//gi}}(args) {",
" return <Component {...args} />;",
"}",
""
]
},
"stories.ts": {
"scope": "typescript,typescriptreact",
"prefix": ["stories", "Story"],
"description": "Create a Storybook file",
"body": [
"import Component from '.';",
"import type {Meta, StoryObj} from '@storybook/react';",
"",
"const meta: Meta<typeof Component> = {",
" component: Component,",
" parameters: {},",
" decorators: [],",
"};",
"",
"export default meta;",
"",
"type Story = StoryObj<typeof meta>;",
"",
"export const Initial: Story = {};",
""
]
}
}