mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 07:01:53 +08:00
17 lines
521 B
Plaintext
17 lines
521 B
Plaintext
```ts
|
|
// Button.stories.ts
|
|
|
|
// We create a “template” of how args map to rendering
|
|
const Template: Story<ButtonProps> = (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: '📚📕📈🤓',};
|
|
```
|
|
|