Created
October 26, 2023 11:24
-
-
Save angelod1as/6ee3f91505dd579b0c6407dfe7d4baef to your computer and use it in GitHub Desktop.
Storybook VSCode React Snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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