Skip to content

Instantly share code, notes, and snippets.

@linuz90
Created March 24, 2022 18:10
Show Gist options
  • Save linuz90/5c5d87fb461620ccefb2ca7cc9d4cf3e to your computer and use it in GitHub Desktop.
Save linuz90/5c5d87fb461620ccefb2ca7cc9d4cf3e to your computer and use it in GitHub Desktop.
{
// To install, open Command Palette, and then: Configure user snippets → New Global Snippets file
// Paste this snippet:
"Create Story": {
"scope": "javascript,javascriptreact,typescript,typescriptreact",
"prefix": "story",
"body": [
"import { ComponentMeta } from '@storybook/react';",
"import React from 'react';",
"import ${1:componentName} from './${1:componentName}';",
"",
"export default {",
" title: '${1:componentName}',",
" component: ${1:componentName},",
" args: {},",
" decorators: [",
" (Story) => (",
" <div>",
" <Story />",
" </div>",
" ),",
" ],",
"} as ComponentMeta<typeof ${1:componentName}>;",
"",
"export const Default = (args) => <${1:componentName} {...args} />;"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment