An open API service indexing awesome lists of open source software.

https://github.com/jhta/storybook-external-links

Decorator to add external links to storybook components after DOM rendering.
https://github.com/jhta/storybook-external-links

external-links scripting storybook

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# 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

```js

import withExternalLinks from 'storybook-external-links'
```

### Vue

```js

import withExternalLinks from 'storybook-external-links/vue'
```
### Use

```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)
```

### Result after story mounting:

```html

```