storybook-external-links
Version:
Storybook external link loaded after components mounting
48 lines (31 loc) • 851 B
Markdown
Decorator to add external links to storybook components after DOM rendering.
```
npm install storybook-external-links
```
```js
import withExternalLinks from 'storybook-external-links'
```
```js
import withExternalLinks from 'storybook-external-links/vue'
```
```js
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)
```
```html
<script src="https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js" async=""></script>
```