mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 03:21:49 +08:00
27 lines
509 B
Plaintext
27 lines
509 B
Plaintext
```ts
|
|
// Button.stories.ts
|
|
|
|
import { html } from 'lit';
|
|
|
|
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
|
|
import { action } from '@storybook/addon-actions';
|
|
|
|
const meta: Meta = {
|
|
title: 'Button',
|
|
component: 'custom-button',
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj;
|
|
|
|
export const Text: Story = {
|
|
render: ({ label, onClick }) =>
|
|
html`<custom-button label="${label}" @click=${onClick}></custom-button>`,
|
|
args: {
|
|
label: 'Hello',
|
|
onClick: action('clicked'),
|
|
},
|
|
};
|
|
```
|