Provides an addon for storybook that can display your template as source in a seperate tab
View on GithubNew to Storybook?Get started
53
Downloads per week
Usage
Install from NPM using thse command
npm i --save-dev storybook-template-source- Register addon in
.storybook/addons.jsusingimport 'storybook-template-source/register'; - Invoke
withTemplateSourcein your story like this:
storiesOf('Test Stories', module)
.add('With template', () => withTemplateSource('<h1>Hello World</h1>'))
Settings
You can provide an optional second object to withTemplateSource to control the behavior. This can be one, any or all of the options below.
{
pretty: boolean = true; // Pretty prints the HTML output. Defaults to true
}
Example without pretty print:
storiesOf('Test Stories', module)
.add('With template', () => withTemplateSource('<h1>Hello World</h1>', { pretty: false }))