storybook/docs/snippets/vue/button-group-story.ts-3.ts.mdx
2022-04-29 20:37:36 +01:00

33 lines
832 B
Plaintext

```ts
// ButtonGroup.stories.ts
import ButtonGroup from './ButtonGroup.vue';
import { Meta, StoryFn } from '@storybook/vue3';
//👇 Imports the Button stories
import * as ButtonStories from './Button.stories';
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: 'ButtonGroup',
component: ButtonGroup,
} as Meta<typeof Button>;
const Template: StoryFn<typeof Button> = (args) => ({
components: { ButtonGroup },
setup() {
return { args };
},
template: '<ButtonGroup v-bind="args" />',
});
export const Pair = Template.bind({});
Pair.args = {
buttons: [{ ...ButtonStories.Primary.args }, { ...ButtonStories.Secondary.args }],
orientation: 'horizontal',
};
```