Skip to content

Commit

Permalink
Docs: Add Preact code snippet for Whats a Story
Browse files Browse the repository at this point in the history
  • Loading branch information
fbredius committed Feb 23, 2022
1 parent 75b8419 commit 0735efa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/get-started/whats-a-story.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]}
/>

Expand Down
14 changes: 14 additions & 0 deletions docs/snippets/preact/button-story.js.mdx
Original file line number Diff line number Diff line change
@@ -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' />;
```

0 comments on commit 0735efa

Please sign in to comment.