storybook/docs/snippets/html/your-component.ts.mdx

24 lines
725 B
Plaintext

```ts
// YourComponent.stories.ts
import { Meta, StoryFn } from '@storybook/html';
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/docsreact/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'YourComponent',
} as Meta;
//👇 We create a “template” of how args map to rendering
const Template: StoryFn = (args): HTMLElement => createYourComponent(args);
export const FirstStory = Template.bind({});
FirstStory.args = {
//👇 The args you need here will depend on your component
};
```