storybook/docs/snippets/vue/button-group-story.ts-2.ts.mdx
2022-07-15 11:09:15 -07:00

31 lines
850 B
Plaintext

```ts
// ButtonGroup.stories.ts
import ButtonGroup from './ButtonGroup.vue';
import type { Meta, StoryFn } from '@storybook/vue';
//👇 Imports the Button stories
import * as ButtonStories from './Button.stories';
export default {
/* 👇 The title prop is optional.
* See https://storybook.js.org/docs/7.0/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, { argTypes }) => ({
components: { ButtonGroup },
props: Object.keys(argTypes),
template: '<ButtonGroup v-bind="$props" />',
});
export const Pair = Template.bind({});
Pair.args = {
buttons: [{ ...ButtonStories.Primary.args }, { ...ButtonStories.Secondary.args }],
orientation: 'horizontal',
};
```