mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 23:02:00 +08:00
18 lines
452 B
Plaintext
18 lines
452 B
Plaintext
```md
|
|
<!-- MyComponent.stories.mdx -->
|
|
|
|
import { Meta, Story } from '@storybook/addon-docs';
|
|
|
|
import { MyComponent } from './MyComponent.component';
|
|
|
|
|
|
<Meta title="img" component={MyComponent}/>
|
|
|
|
<!-- Render functions are a framework specific feature to allow you control on how the component renders -->
|
|
|
|
<Story
|
|
name="withAnImage"
|
|
render={() => ({
|
|
template: `<img src="https://place-hold.it/350x150" alt="My CDN placeholder" />`,
|
|
})} />
|
|
``` |