mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-06 06:41:25 +08:00
11 KiB
11 KiB
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 FirstStory: 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 FirstStory = {
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 FirstStory: 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 FirstStory = {
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 FirstStory = {
args: {
//👇 The args you need here will depend on your component
},
};
import type { Meta, StoryObj } from '@storybook/react';
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 FirstStory: Story = {
args: {
//👇 The args you need here will depend on your component
},
};
import type { Meta, StoryObj } from '@storybook/react';
import { YourComponent } from './YourComponent';
//👇 This default export determines where your story goes in the story list
const meta: Meta<typeof YourComponent> = {
component: YourComponent,
};
export default meta;
type Story = StoryObj<typeof YourComponent>;
export const FirstStory: 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 FirstStory = {
args: {
//👇 The args you need here will depend on your component
},
};
import type { Meta, StoryObj } from 'storybook-solidjs';
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 FirstStory: Story = {
args: {
//👇 The args you need here will depend on your component
},
};
import type { Meta, StoryObj } from 'storybook-solidjs';
import { YourComponent } from './YourComponent';
//👇 This default export determines where your story goes in the story list
const meta: Meta<typeof YourComponent> = {
component: YourComponent,
};
export default meta;
type Story = StoryObj<typeof YourComponent>;
export const FirstStory: Story = {
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,
};
/*
*👇 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 FirstStory = {
render: (args) => ({
Component: YourComponent,
props: args,
}),
args: {
//👇 The args you need here will depend on your component
},
};
{/* YourComponent.stories.svelte */}
<script>
import { Meta, Template, Story } from '@storybook/addon-svelte-csf';
import YourComponent from './YourComponent.svelte';
</script>
{/*👇 The title determines where your story goes in the story list */}
<Meta title="YourComponent" component={YourComponent} argTypes={{ /* Customize your args here
depending on your component */ }} />
<template let:args>
<button {...args} />
</template>
<Story name="FirstStory" args={{ /* The args you need here will depend on your component */ }} />
import type { Meta, StoryObj } from '@storybook/svelte';
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 FirstStory: Story = {
args: {
//👇 The args you need here will depend on your component
},
};
import type { Meta, StoryObj } from '@storybook/svelte';
import YourComponent from './YourComponent.svelte';
//👇This default export determines where your story goes in the story list
const meta: Meta<typeof YourComponent> = {
component: YourComponent,
};
export default meta;
type Story = StoryObj<typeof meta>;
export const FirstStory: 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 FirstStory = {
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';
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 Primary: 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 type { Meta, StoryObj } from '@storybook/vue3';
import YourComponent from './YourComponent.vue';
const meta: Meta<typeof YourComponent> = {
component: YourComponent,
};
//👇 This default export determines where your story goes in the story list
export default meta;
type Story = StoryObj<typeof 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 Primary: 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 FirstStory = {
args: {
// 👇 The args you need here will depend on your component
},
};
import type { Meta, StoryObj } from '@storybook/web-components';
// 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 FirstStory: Story = {
args: {
// 👇 The args you need here will depend on your component
},
};