mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-02 05:03:44 +08:00
Docs: Add Preact code snippet for Whats a Story
This commit is contained in:
parent
75b841912c
commit
40f983487b
@ -27,6 +27,7 @@ Let’s start with the `Button` component. A story is a function that describes
|
||||
'web-components/button-story.js.mdx',
|
||||
'html/button-story.js.mdx',
|
||||
'html/button-story.ts.mdx',
|
||||
'preact/button-story.js.mdx',
|
||||
]}
|
||||
/>
|
||||
|
||||
|
14
docs/snippets/preact/button-story.js.mdx
Normal file
14
docs/snippets/preact/button-story.js.mdx
Normal file
@ -0,0 +1,14 @@
|
||||
```js
|
||||
// Button.stories.js|jsx
|
||||
|
||||
/** @jsx h */
|
||||
import { h } from 'preact';
|
||||
import { Button } from './Button';
|
||||
|
||||
export default {
|
||||
title: 'Button',
|
||||
component: Button,
|
||||
}
|
||||
|
||||
export const Primary = () => <Button primary label='Button' />;
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user