@kadira/storybook-addon-links

1.0.1 • Public • Published

Story Links Addon

The Story Links addon can be used to create links between stories. This addon works with both React Storybook and React Native Storybook (included by default).

Getting Started

First, install the addon

npm install -D @kadira/storybook-addon-links

Add this line to your addons.js file (create this file inside your storybook config directory if needed).

import '@kadira/storybook-addon-links/register';

Import the linkTo function and use it to create links. When creating links, provide the target story info.

import { storiesOf } from '@kadira/storybook'
import { linkTo } from '@kadira/storybook-addon-links'

storiesOf('Button', module)
  .add('First', () => (
    <button onClick={linkTo('Button', 'Second')}>Go to "Second"</button>
  ))
  .add('Second', () => (
    <button onClick={linkTo('Button', 'First')}>Go to "First"</button>
  ));

Dependencies (0)

    Dev Dependencies (10)

    Package Sidebar

    Install

    npm i @kadira/storybook-addon-links

    Weekly Downloads

    1,675

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • madushan1000
    • kadira_user
    • thinkholic
    • pahans
    • roonyh
    • mnmtanish
    • arunoda