mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 03:41:54 +08:00
43 lines
774 B
Plaintext
43 lines
774 B
Plaintext
```md
|
|
<!-- Badge.stories.mdx --->
|
|
|
|
import { Canvas, Meta, Story } from '@storybook/addon-docs';
|
|
|
|
import { Badge } from './badge.component';
|
|
|
|
<Meta title="Badge" component={Badge} />
|
|
|
|
<!-- Render functions are a framework specific feature to allow you control on how the component renders -->
|
|
|
|
<Canvas>
|
|
<Story
|
|
name="warning"
|
|
args={{
|
|
status: 'warning',
|
|
label: 'Warning',
|
|
}}
|
|
render={(args) => ({
|
|
props: args,
|
|
})} />
|
|
|
|
<Story
|
|
name="neutral"
|
|
args={{
|
|
status: 'neutral',
|
|
label: 'Neutral',
|
|
}}
|
|
render={(args) => ({
|
|
props: args,
|
|
})} />
|
|
|
|
<Story
|
|
name="error"
|
|
args={{
|
|
status: 'error',
|
|
label: 'Error',
|
|
}}
|
|
render={(args) => ({
|
|
props: args,
|
|
})} />
|
|
</Canvas>
|
|
``` |