storybook/docs/snippets/react/button-story-with-args.ts.mdx
2021-05-18 09:32:32 +08:00

17 lines
335 B
Plaintext

```ts
// Button.stories.tsx
import React from 'react';
import { Story } from '@storybook/react';
//👇 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',
};
```