```ts filename="MyComponent.stories.ts" renderer="angular" language="ts" import type { Meta, StoryObj } from '@storybook/angular'; import { MyComponent } from './MyComponent.component'; const meta: Meta = { component: MyComponent, }; export default meta; type Story = StoryObj; export const Default: Story = {}; export const WithProp: Story = { render: () => ({ props: { prop: 'value', }, }), }; ``` ```js filename="MyComponent.stories.js|jsx" renderer="react" language="js" import { MyComponent } from './MyComponent'; export default { component: MyComponent, }; export const Basic = {}; export const WithProp = { render: () => , }; ``` ```tsx filename="MyComponent.stories.ts|tsx" renderer="react" language="ts-4-9" import type { Meta, StoryObj } from '@storybook/react'; import { MyComponent } from './MyComponent'; const meta = { component: MyComponent, } satisfies Meta; export default meta; type Story = StoryObj; export const Basic: Story = {}; export const WithProp: Story = { render: () => , }; ``` ```tsx filename="MyComponent.stories.ts|tsx" renderer="react" language="ts" import type { Meta, StoryObj } from '@storybook/react'; import { MyComponent } from './MyComponent'; const meta: Meta = { component: MyComponent, }; export default meta; type Story = StoryObj; export const Basic: Story = {}; export const WithProp: Story = { render: () => , }; ``` ```js filename="MyComponent.story.js|jsx" renderer="solid" language="js" import { MyComponent } from './MyComponent'; export default { component: MyComponent, }; export const Basic = {}; export const WithProp = { render: () => , }; ``` ```tsx filename="MyComponent.story.ts|tsx" renderer="solid" language="ts-4-9" import type { Meta, StoryObj } from 'storybook-solidjs'; import { MyComponent } from './MyComponent'; const meta = { component: MyComponent, } satisfies Meta; export default meta; type Story = StoryObj; export const Basic: Story = {}; export const WithProp: Story = { render: () => , }; ``` ```tsx filename="MyComponent.story.ts|tsx" renderer="solid" language="ts" import type { Meta, StoryObj } from 'storybook-solidjs'; import { MyComponent } from './MyComponent'; const meta: Meta = { component: MyComponent, }; export default meta; type Story = StoryObj; export const Basic: Story = {}; export const WithProp: Story = { render: () => , }; ``` ```js filename="MyComponent.stories.js" renderer="svelte" language="js" import MyComponent from './MyComponent.svelte'; export default { component: MyComponent, }; export const Basic = {}; /* *👇 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 WithProp = { render: () => ({ Component: MyComponent, props: { prop: 'value', }, }), }; ``` ```html renderer="svelte" language="ts" tabTitle="native-format" {/* MyComponent.stories.svelte */} ``` ```ts filename="MyComponent.stories.ts" renderer="svelte" language="ts-4-9" import type { Meta, StoryObj } from '@storybook/svelte'; import MyComponent from './MyComponent.svelte'; const meta = { component: MyComponent, } satisfies Meta; export default meta; type Story = StoryObj; export const Basic: Story = {}; /* *👇 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 WithProp: Story = { render: () => ({ Component: MyComponent, props: { prop: 'value', }, }), }; ``` ```ts filename="MyComponent.stories.ts" renderer="svelte" language="ts" import type { Meta, StoryObj } from '@storybook/svelte'; import MyComponent from './MyComponent.svelte'; const meta: Meta = { component: MyComponent, }; export default meta; type Story = StoryObj; export const Basic: Story = {}; /* *👇 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 WithProp: Story = { render: () => ({ Component: MyComponent, props: { prop: 'value', }, }), }; ``` ```js filename="MyComponent.stories.js" renderer="vue" language="js" import MyComponent from './MyComponent.vue'; export default { component: MyComponent, }; export const Basic = { render: () => ({ components: { MyComponent }, template: '', }), }; export const WithProp = { render: () => ({ components: { MyComponent }, template: '', }), }; ``` ```ts filename="MyComponent.stories.ts" renderer="vue" language="ts-4-9" import type { Meta, StoryObj } from '@storybook/vue3'; import MyComponent from './MyComponent.vue'; const meta = { component: MyComponent, } satisfies Meta; export default meta; type Story = StoryObj; export const Basic: Story = { render: () => ({ components: { MyComponent }, template: '', }), }; export const WithProp: Story = { render: () => ({ components: { MyComponent }, template: '', }), }; ``` ```ts filename="MyComponent.stories.ts" renderer="vue" language="ts" import type { Meta, StoryObj } from '@storybook/vue3'; import MyComponent from './MyComponent.vue'; const meta: Meta = { component: MyComponent, }; export default meta; type Story = StoryObj; export const Basic: Story = { render: () => ({ components: { MyComponent }, template: '', }), }; export const WithProp: Story = { render: () => ({ components: { MyComponent }, template: '', }), }; ``` ```js filename="MyComponent.stories.js" renderer="web-components" language="js" import { html } from 'lit'; export default { title: 'Path/To/MyComponent', component: 'my-component', }; export const Basic = {}; export const WithProp = { render: () => html``, }; ``` ```ts filename="MyComponent.stories.ts" renderer="web-components" language="ts" import type { Meta, StoryObj } from '@storybook/web-components'; import { html } from 'lit'; const meta: Meta = { component: 'my-component', }; export default meta; type Story = StoryObj; export const Basic: Story = {}; export const WithProp: Story = { render: () => html``, }; ```