@storybook-tiny/vanjs
v1.0.3
Published
A tiny storybook for vanjs
Downloads
82
Maintainers
Readme
@storybook-tiny/vanjs
A tiny storybook for vanjs.
usage
initial setup:
# add to your project
npm i vanjs-core
npm i -D @storybook-tiny/vanjs
# 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/vanjs'
import van from 'vanjs-core'
const { small } = van.tags
// describe your stories...
const storyButton = {
title: 'Button',
component: () => van.tags.button({ onclick: () => alert('Hi') }, 'Click me')
}
// define stories in storybook
van.add(
document.getElementById('app'),
Storybook({
stories: [
small('Components'),
storyButton
]
})
)
Then run with vite:
npx vite --open /stories/
license
MIT licensed