Add your-component.js snippet for html framework

This commit is contained in:
WIVSW 2022-01-22 22:58:02 +05:00
parent 9909f9a39e
commit 841fe3753d
2 changed files with 23 additions and 0 deletions

View File

@ -23,6 +23,7 @@ Pick a simple component from your project, like a Button, and write a `.stories.
'svelte/your-component.native-format.mdx',
'svelte/your-component.mdx.mdx',
'web-components/your-component.js.mdx',
'html/your-component.js.mdx',
]}
/>

View File

@ -0,0 +1,22 @@
```js
// YourComponent.stories.js
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',
};
// 👇 We create a “template” of how args map to rendering
const Template = (args) => createYourComponent(args);
export const FirstStory = Template.bind({});
FirstStory.args = {
// 👇 The args you need here will depend on your component
};
```