storybook/docs/snippets/web-components/my-component-story-basic-and-props.ts.mdx
2022-12-23 18:48:39 +00:00

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" />`,
};
```