storybook/docs/snippets/web-components/button-story-with-args.js.mdx
2021-06-18 17:34:13 +01:00

24 lines
468 B
Plaintext

```js
// demo-button.stories.js
import { html } from 'lit-html';
import './demo-button';
export default {
title: 'Components/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',
};
```