docs/_snippets/your-component.md
import type { Meta, StoryObj } from '@storybook/angular';
import { YourComponent } from './your.component';
//๐ This default export determines where your story goes in the story list
const meta: Meta<YourComponent> = {
component: YourComponent,
};
export default meta;
type Story = StoryObj<YourComponent>;
export const Basic: Story = {
args: {
//๐ The args you need here will depend on your component
},
};
import preview from '../.storybook/preview';
import { YourComponent } from './your.component';
//๐ This default export determines where your story goes in the story list
const meta = preview.meta({
component: YourComponent,
});
export const Basic = meta.story({
args: {
//๐ The args you need here will depend on your component
},
});
import { createYourComponent } from './YourComponent';
// ๐ This default export determines where your story goes in the story list
export default {
/* ๐ The title prop is optional.
* See https://storybook.js.org/docs/configure/#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'YourComponent',
};
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic = {
render: (args) => createYourComponent(args),
args: {
// ๐ The args you need here will depend on your component
},
};
import type { Meta, StoryObj } from '@storybook/html';
import { createYourComponent, ComponentProps } from './YourComponent';
//๐ This default export determines where your story goes in the story list
const meta: Meta<ComponentProps> = {
/* ๐ The title prop is optional.
* See https://storybook.js.org/docs/configure/#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'YourComponent',
};
export default meta;
type Story = StoryObj<ComponentProps>;
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic: Story = {
render: (args) => createYourComponent(args),
args: {
// ๐ The args you need here will depend on your component
},
};
/** @jsx h */
import { h } from 'preact';
import { YourComponent } from './YourComponent';
//๐ This default export determines where your story goes in the story list
export default {
component: YourComponent,
};
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic = {
render: (args) => <YourComponent {...args} />,
args: {
//๐ The args you need here will depend on your component
},
};
import { YourComponent } from './YourComponent';
//๐ This default export determines where your story goes in the story list
export default {
component: YourComponent,
};
export const Basic = {
args: {
//๐ The args you need here will depend on your component
},
};
// Replace your-framework with the framework you are using, e.g. react-vite, nextjs, nextjs-vite, etc.
import type { Meta, StoryObj } from '@storybook/your-framework';
import { YourComponent } from './YourComponent';
//๐ This default export determines where your story goes in the story list
const meta = {
component: YourComponent,
} satisfies Meta<typeof YourComponent>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Basic: Story = {
args: {
//๐ The args you need here will depend on your component
},
};
import { YourComponent } from './YourComponent';
//๐ This default export determines where your story goes in the story list
export default {
component: YourComponent,
};
export const Basic = {
args: {
//๐ The args you need here will depend on your component
},
};
import type { Meta, StoryObj } from 'storybook-solidjs-vite';
import { YourComponent } from './YourComponent';
//๐ This default export determines where your story goes in the story list
const meta = {
component: YourComponent,
} satisfies Meta<typeof YourComponent>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Basic: Story = {
args: {
//๐ The args you need here will depend on your component
},
};
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import YourComponent from './YourComponent.svelte';
//๐ This export determines where your story goes in the story list
const { Story } = defineMeta({
component: YourComponent,
});
</script>
<Story
name="Basic"
args={{
/*๐ The args you need here will depend on your component */
}}
/>
import YourComponent from './YourComponent.svelte';
//๐ This default export determines where your story goes in the story list
export default {
component: YourComponent,
};
export const Basic = {
args: {
//๐ The args you need here will depend on your component
},
};
<script module>
import { defineMeta } from '@storybook/addon-svelte-csf';
import YourComponent from './YourComponent.svelte';
//๐ This export determines where your story goes in the story list
const { Story } = defineMeta({
component: YourComponent,
});
</script>
<Story
name="Basic"
args={{
/*๐ The args you need here will depend on your component */
}}
/>
// Replace your-framework with svelte-vite or sveltekit
import type { Meta, StoryObj } from '@storybook/your-framework';
import YourComponent from './YourComponent.svelte';
//๐ This default export determines where your story goes in the story list
const meta = {
component: YourComponent,
} satisfies Meta<typeof YourComponent>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Basic: Story = {
args: {
//๐ The args you need here will depend on your component
},
};
import YourComponent from './YourComponent.vue';
//๐ This default export determines where your story goes in the story list
export default {
component: YourComponent,
};
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic = {
render: (args) => ({
components: { YourComponent },
setup() {
return { args };
},
template: '<YourComponent v-bind="args" />',
}),
args: {
//๐ The args you need here will depend on your component
},
};
import type { Meta, StoryObj } from '@storybook/vue3-vite';
import YourComponent from './YourComponent.vue';
const meta = {
component: YourComponent,
} satisfies Meta<typeof YourComponent>;
//๐ This default export determines where your story goes in the story list
export default meta;
type Story = StoryObj<typeof meta>;
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic: Story = {
render: (args) => ({
components: { YourComponent },
setup() {
return { args };
},
template: '<YourComponent v-bind="args" />',
}),
args: {
//๐ The args you need here will depend on your component
},
};
import preview from '../.storybook/preview';
import YourComponent from './YourComponent.vue';
//๐ This default export determines where your story goes in the story list
const meta = preview.meta({
component: YourComponent,
});
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic = meta.story({
render: (args) => ({
components: { YourComponent },
setup() {
return { args };
},
template: '<YourComponent v-bind="args" />',
}),
args: {
//๐ The args you need here will depend on your component
},
});
import preview from '../.storybook/preview';
import YourComponent from './YourComponent.vue';
//๐ This default export determines where your story goes in the story list
const meta = preview.meta({
component: YourComponent,
});
/*
*๐ Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/api/csf
* to learn how to use render functions.
*/
export const Basic = meta.story({
render: (args) => ({
components: { YourComponent },
setup() {
return { args };
},
template: '<YourComponent v-bind="args" />',
}),
args: {
//๐ The args you need here will depend on your component
},
});
// This default export determines where your story goes in the story list
export default {
component: 'demo-your-component',
};
export const Basic = {
args: {
// ๐ The args you need here will depend on your component
},
};
import type { Meta, StoryObj } from '@storybook/web-components-vite';
// This default export determines where your story goes in the story list
const meta: Meta = {
component: 'demo-your-component',
};
export default meta;
type Story = StoryObj;
export const Basic: Story = {
args: {
// ๐ The args you need here will depend on your component
},
};
import preview from '../.storybook/preview';
// ๐ This default export determines where your story goes in the story list
const meta = preview.meta({
component: 'demo-your-component',
});
export const Basic = meta.story({
args: {
// ๐ The args you need here will depend on your component
},
});
import preview from '../.storybook/preview';
// ๐ This default export determines where your story goes in the story list
const meta = preview.meta({
component: 'demo-your-component',
});
export const Basic = meta.story({
args: {
// ๐ The args you need here will depend on your component
},
});
import preview from '../.storybook/preview';
import { YourComponent } from './YourComponent';
//๐ This default export determines where your story goes in the story list
const meta = preview.meta({
component: YourComponent,
});
export const Basic = meta.story({
args: {
//๐ The args you need here will depend on your component
},
});
import preview from '../.storybook/preview';
import { YourComponent } from './YourComponent';
const meta = preview.meta({
component: YourComponent,
});
export const Basic = meta.story({
args: {
//๐ The args you need here will depend on your component
},
});