storybook-twig
Storybook for Twig: View TWIG templates in isolation with Hot Reloading.
Last updated a year ago by markhuot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install storybook-twig 
SYNC missed versions from official npm registry.

Storybook for Twig


Storybook for HTML is a UI development environment for your plain HTML snippets. With it, you can visualize different states of your UI components and develop them interactively.

Storybook Screenshot

Storybook runs outside of your app. So you can develop UI components in isolation without worrying about app specific dependencies and requirements.

Getting Started

Your .storybook/config.js should look something like this,

import { configure } from 'storybook-twig';
configure(() => {
    // ... load stories
}, module);

Then each story should then return the rendered HTML of your twig template. You are free to use any of the add-ons that the native HTML stories support.

import { storiesOf } from 'storybook-twig'
import { withKnobs, text, boolean, number } from '@storybook/addon-knobs'
import template from './test.twig'

const stories = storiesOf('Twig', module)
stories.addDecorator(withKnobs)
stories.add('with knobs', () => {
    return template({
        test: text('test', 'foo bar'),
    })
})

For more information visit: storybook.js.org


Storybook also comes with a lot of addons and a great API to customize as you wish. You can also build a static version of your storybook and deploy it anywhere you want.

Current Tags

  • 1.0.4                                ...           latest (a year ago)

5 Versions

  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (7)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |