Last active
September 30, 2021 04:03
-
-
Save lmartim/59504e8491eb23b0f2efa6bb7f1f374b to your computer and use it in GitHub Desktop.
Button component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//.src/components/Button/Button.stories.js | |
import Button from './Button.vue' | |
export default { | |
title: 'Components/Button', | |
component: { Button }, | |
argTypes: { | |
label: { | |
type: 'string' | |
}, | |
type: { | |
options: ['primary', 'secondary', 'tertiary', 'subtle', 'destructive'], | |
control: { | |
type: 'select' | |
} | |
}, | |
size: { | |
options: ['sm', 'lg'], | |
control: { | |
type: 'select' | |
} | |
}, | |
} | |
} | |
const Template = (args) => ({ | |
components: { Button }, | |
setup() { | |
return { args } | |
}, | |
template: ` | |
<Button v-bind="args" /> | |
` | |
}) | |
export const Primary = Template.bind({}) | |
Primary.args = { | |
type: 'primary', | |
size: 'md', | |
label: 'Button Stories' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment