storybook/docs/snippets/react/button-story-using-args.js.mdx
2020-08-07 17:05:17 +01:00

15 lines
499 B
Plaintext

```js
// Button.stories.js
// We create a “template” of how args map to rendering
const Template = (args) => <Button {...args} />;
// Each story then reuses that template
export const Primary = Template.bind({});
Primary.args = { background="#ff0", label: 'Button' };
export const Secondary = Template.bind({});
Secondary.args = { ...Primary.args, label: '😄👍😍💯',};
export const Tertiary = Template.bind({});
Tertiary.args = { ...Primary.args, label: '📚📕📈🤓',};
```