fbredius/storybook

View on GitHub
docs/snippets/web-components/button-story-with-args.js.mdx

Summary

Maintainability
Test Coverage
```js
// demo-button.stories.js

import { html } from 'lit-html';

import './demo-button';

export default {
  title: 'Button',
};

//👇 We create a “template” of how args map to rendering
const Template = ({ primary, label }) =>
  html`<demo-button ?primary=${primary} .label=${label}></demo-button>`;

//👇 Each story then reuses that template
export const Primary = Template.bind({});

Primary.args = {
  primary: true,
  label: 'Button',
};
```