storybook/docs/snippets/web-components/button-story-component-args-primary.js.mdx
2022-07-07 18:04:56 +01:00

30 lines
787 B
Plaintext

```js
// demo-button.stories.js
import { Button } from './demo-button';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/7.0/web-components/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
//👇 Creates specific argTypes
argTypes: {
backgroundColor: { control: 'color' },
},
args: {
//👇 Now all Button stories will be primary.
primary: true,
},
};
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/7.0/web-components/api/csf
* to learn how to use render functions.
*/
export const Primary = {
render: ({ primary }) => Button({ primary }),
};
```