mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-02 05:03:44 +08:00
17 lines
335 B
Plaintext
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',
|
|
};
|
|
``` |