mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 05:41:07 +08:00
32 lines
717 B
Plaintext
32 lines
717 B
Plaintext
```ts
|
|
// ButtonGroup.stories.ts
|
|
|
|
import { moduleMetadata } from '@storybook/angular';
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
import ButtonGroup from './ButtonGroup.component';
|
|
import Button from './button.component';
|
|
import * as ButtonStories from './Button.stories';
|
|
|
|
export default {
|
|
title: 'ButtonGroup',
|
|
component: ButtonGroup,
|
|
decorators: [
|
|
moduleMetadata({
|
|
declarations: [Button],
|
|
imports: [CommonModule],
|
|
}),
|
|
],
|
|
};
|
|
|
|
const Template = (args: ButtonGroup) => ({
|
|
component :ButtonGroup,
|
|
props: args,
|
|
});
|
|
|
|
export const Pair = Template.bind({});
|
|
Pair.args = {
|
|
buttons: [ ...ButtonStories.Primary.args, ...ButtonStories.Secondary.args ],
|
|
orientation: 'horizontal',
|
|
};
|
|
``` |