storybook/docs/snippets/html/button-story.js.mdx
2022-11-17 16:33:22 +01:00

32 lines
743 B
Plaintext

```js
// Button.stories.js
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/html/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
};
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/7.0/html/api/csf
* to learn how to use render functions.
*/
export const Primary = {
render: () => {
const btn = document.createElement('button');
btn.innerText = 'Button';
btn.className = [
'storybook-button',
'storybook-button--medium',
'storybook-button--primary',
].join(' ');
return btn;
},
};
```