storybook/docs/snippets/web-components/component-story-static-asset-cdn.ts.mdx
2023-01-05 14:53:03 +00:00

28 lines
640 B
Plaintext

```ts
// MyComponent.stories.ts
import { html } from 'lit-html';
import type { Meta, StoryObj } from '@storybook/web-components';
const meta: Meta = {
title: 'img',
component: 'my-component',
};
export default meta;
type Story = StoryObj;
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/7.0/web-components/api/csf
* to learn how to use render functions.
*/
export const WithAnImage: Story = {
render: () => html`<img
src="https://storybook.js.org/images/placeholders/350x150.png"
alt="My CDN placeholder"
/>`,
};
```