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

22 lines
441 B
Plaintext

```ts
// Button.stories.ts | Button.stories.tsx
import React from 'react';
import { Story, Meta } from '@storybook/react';
export default {
component: Button,
title: 'Components/Button',
} as Meta;
//👇 We create a “template” of how args map to rendering
const Template: Story<ButtonProps> = (args) => <Button {...args} />;
export const Primary = Template.bind({});
Primary.args = {
primary: true,
label: 'Button',
};
```