storybook-external-links

0.1.0 • Public • Published

Storybook External Links

Decorator to add external links to storybook components after DOM rendering.

Install

npm install storybook-external-links

How to use it?

React

 
import withExternalLinks from 'storybook-external-links'

Vue

 
import withExternalLinks from 'storybook-external-links/vue'

Use

 
const url = 'https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js'
 
// script tag arguments - optional
const options = {
 async: true,
}
 
const externalLinkDecorator = withExternalLinks(url, options)
 
storiesOf('Button')
 .addDecorator(externalLinkDecorator)
 .add(myStory)

Result after story mounting:

<script src="https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js" async=""></script>

Package Sidebar

Install

npm i storybook-external-links

Weekly Downloads

546

Version

0.1.0

License

ISC

Unpacked Size

3.67 kB

Total Files

6

Last publish

Collaborators

  • jhta