Skip to content

Instantly share code, notes, and snippets.

@angelod1as
Created October 26, 2023 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelod1as/6ee3f91505dd579b0c6407dfe7d4baef to your computer and use it in GitHub Desktop.
Save angelod1as/6ee3f91505dd579b0c6407dfe7d4baef to your computer and use it in GitHub Desktop.
Storybook VSCode React Snippet
// Add this to your typescript.json snippet file in VSCode
// cmd+shift+p > Snippet: configure user snippets > typescript.json
{
// OTHER SNIPPETS ABOVE
"Storybook CSF 3.0": {
"scope": "typescript,typescriptreact",
"prefix": "storybook",
"body": [
"import type { Meta, StoryObj } from '@storybook/react'",
"",
"import { $1 } from './$1'",
"",
"const meta: Meta<typeof $1> = {",
" // Update the path",
" title: 'Common/$1',",
" component: $1,",
" argTypes: {",
" className: { table: { disable: true } },",
" },",
"}",
"",
"export default meta",
"type Story = StoryObj<typeof $1>",
"",
"// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args",
"export const Primary: Story = {}"
],
"description": "Storybook Story CSF 3.0 for React "
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment