mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 03:11:49 +08:00
46 lines
707 B
Plaintext
46 lines
707 B
Plaintext
```js
|
|
// Button.stories.js
|
|
|
|
import Button from './Button.svelte';
|
|
|
|
export default {
|
|
component: Button,
|
|
};
|
|
|
|
|
|
//👇 The render function is a framework specific construct to tell how the story should render
|
|
|
|
export const Primary = {
|
|
args: {
|
|
backgroundColor: '#ff0',
|
|
label: 'Button',
|
|
},
|
|
render: (args) => ({
|
|
Component: Button,
|
|
props: args,
|
|
}),
|
|
};
|
|
|
|
export const Secondary = {
|
|
args: {
|
|
...Primary.args,
|
|
label: '😄👍😍💯',
|
|
},
|
|
render: (args) => ({
|
|
Component: Button,
|
|
props: args,
|
|
}),
|
|
};
|
|
|
|
export const Tertiary = {
|
|
args: {
|
|
...Primary.args,
|
|
label: '📚📕📈🤓',
|
|
},
|
|
render: (args) => ({
|
|
Component: Button,
|
|
props: args,
|
|
}),
|
|
};
|
|
```
|