1.1.0 • Published 3 years ago

storybook-template-source v1.1.0

Weekly downloads
60
License
ISC
Repository
github
Last release
3 years ago

Usage

Install from NPM using thse command

  1. npm i --save-dev storybook-template-source
  2. Register addon in .storybook/addons.js using import 'storybook-template-source/register';
  3. Invoke withTemplateSource in 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 }))
1.1.0

3 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago