Skip to content

Instantly share code, notes, and snippets.

@Lucasdsk
Created March 24, 2020 14:06
Show Gist options
  • Save Lucasdsk/196f4733f2ff418906805002364d7c0d to your computer and use it in GitHub Desktop.
Save Lucasdsk/196f4733f2ff418906805002364d7c0d to your computer and use it in GitHub Desktop.
Snippet to create Storybook stories
{
"Create a story": {
"scope": "javascript, typescript",
"prefix": "story",
"body": [
"import React from 'react'",
"import ${TM_FILENAME_BASE/(.*)\\..+$/$1/} from '.'",
"",
"export default {",
"\ttitle: '${2:My Story}',",
"\tcomponent: ${TM_FILENAME_BASE/(.*)\\..+$/$1/}",
"}",
"",
"export const ${TM_FILENAME_BASE/(.*)\\..+$/Story$1/} = () => <${TM_FILENAME_BASE/(.*)\\..+$/$1/} />",
""
],
"description": "Creates a new Story based on the storybook"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment