mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 05:41:49 +08:00
25 lines
537 B
Plaintext
25 lines
537 B
Plaintext
```ts
|
|
// MyComponent.stories.ts
|
|
|
|
import { html } from 'lit-html';
|
|
|
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
|
|
import type { MyComponentProps } from './MyComponent';
|
|
import { MyComponent } from './MyComponent';
|
|
|
|
const meta: Meta<MyComponentProps> = {
|
|
title: 'Path/To/MyComponent',
|
|
render: (args) => MyComponent(args),
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<MyComponentProps>;
|
|
|
|
export const Basic: Story = {};
|
|
|
|
export const WithProp: Story = {
|
|
render: () => html`<my-component prop="value" />`,
|
|
};
|
|
```
|