1.0.2 • Published 8 months ago

@storybook-tiny/preact v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@storybook-tiny/preact

A tiny storybook for preact.

usage

initial setup:

# add to your project
npm i preact
npm i -D @storybook-tiny/preact

# install storybook template auto-detecting your package-manager
npx storybook-tiny
# or with pnpm
npx storybook-tiny -p pnpm

define some stories:

import Storybook from '@storybook-tiny/preact'
import { render } from 'preact'

// describe your stories...
const storyButton = {
  title: 'Button',
  component: () => <button onClick={() => alert('Hi')}>Click Me</button>
}

// define stories in storybook
render(
  <Storybook
    stories={[
      <small key="1">Components</small>, 
      storyButton
    ]}
  />,
  document.getElementById('app')
)

Then run with vite:

npx vite --open /stories/

license

MIT licensed

1.0.2

8 months ago

1.0.1

11 months ago

1.0.0

11 months ago