docs/snippets/vue/button-story-with-args.3.js.mdx
```js
// Button.stories.js
import Button from './Button.vue';
export default {
/* π The title prop is optional.
* See https://storybook.js.org/docs/vue/configure/overview#configure-story-loading
* to learn how to generate automatic titles
*/
title: 'Button',
component: Button,
};
//π We create a βtemplateβ of how args map to rendering
const Template = (args) => ({
components: { Button },
setup() {
//π The args will now be passed down to the template
return { args };
},
template: '<Button v-bind="args" />',
});
//π Each story then reuses that template
export const Primary = Template.bind({});
Primary.args = {
primary: true,
label: 'Button',
};
```