storybook/docs/snippets/angular/button-story-auto-docs.ts.mdx
Tom Coleman 427ec4433d Rename docsPage to autodocs
And change semantics: `docsPage:true` = `autodocs: 'tag'` and `docsPage: 'automatic'` = `autodocs: true`.
2022-12-21 21:49:57 +11:00

35 lines
608 B
Plaintext

```ts
// Button.stories.ts
import type { Meta, StoryObj } from '@storybook/angular';
import { Button } from './button.component';
const meta: Meta<Button> = {
title: 'Button',
component: Button,
//👇 Enables auto-generated documentation for the component story
tags: ['autodocs'],
argTypes: {
backgroundColor: { control: 'color' },
},
};
export default meta;
type Story = StoryObj<typeof Button>;
export const Primary: Story = {
args: {
primary: true,
label: 'Button',
},
};
export const Secondary: Story = {
args: {
...Primary.args,
primary: false,
},
};
```