Skip to content

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

Notifications You must be signed in to change notification settings

jhta/storybook-external-links

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published