mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:21:17 +08:00
26 lines
562 B
Plaintext
26 lines
562 B
Plaintext
```ts
|
|
// Button.stories.js | Button.stories.jsx
|
|
|
|
import React from 'react';
|
|
|
|
import { Button } from './Button';
|
|
|
|
export default {
|
|
component: Button,
|
|
};
|
|
|
|
// The render function is a framework specific construct to define how the story should render
|
|
|
|
export const Primary = {
|
|
render: () => <Button backgroundColor="#ff0" label="Button" />,
|
|
};
|
|
|
|
export const Secondary = {
|
|
render: () => <Button backgroundColor="#ff0" label="😄👍😍💯" />,
|
|
};
|
|
|
|
export const Tertiary = {
|
|
render: () => <Button backgroundColor="#ff0" label="📚📕📈🤓" />,
|
|
};
|
|
```
|