question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Substories/Hierarchy

See original GitHub issue

Would be nice to be able to have “Substories” or a Hierarchy of stories. My case involves various mini “apps” being contained in the same repo. A simple solution would be an option to display stores named like ui.core.foo and ui.core.bar like:

ui
└── core
    ├── bar
    └── foo

With support for expanding and collapsing nodes.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:113
  • Comments:80 (32 by maintainers)

github_iconTop GitHub Comments

72reactions
arunodacommented, Apr 28, 2016

Currently, we’ve no plan to implement that. That’s because it makes navigation harder. You can namespace story kinds with dot like “ui.core”, “ui.app”. Then you can filter them as you need.

If there are a lot of stories, you can start a few storybook instances. You can do that by having two storybook config directories. But, anyway that’s an extreme case.

16reactions
usulprocommented, Mar 15, 2017

Hey, Guys!

Despite the fact that such a feature isn’t planned in the near future this doesn’t mean that we can’t get such behavior via Storybook Addons API

Here is a such addon:

Storybook Chapters

Storybook Chapters

Adds unlimited levels of nesting for (sub)stories

preview

To add one more nesting level just put .chapter(name) to your stories:

// stories.js:

storiesOf('React App', module)
    .chapter('Left panel')
        .add('Button 1', fn(1))
        .add('Button 2', fn(2))
        .chapter('Bottom Panel')
            .add('Input 3', fn(3))
            .add('Input 4', fn(4))
            .endOfChapter()
        .chapter('Header Panel')
            .add('Input 5', fn(5))
            .add('Input 6', fn(6))
            .endOfChapter()
        .endOfChapter()
    .chapter('Right panel')
        .add('Button 7', fn(7))
        .add('Button 8', fn(8))
        .endOfChapter()

Features

  • The hierarchical structure of Substories
  • Compatible with Knobs, addWithInfo and other addons
  • Use storyDecorator to wrap all chapters

Demo page

Project

Example


Any feedback will be very appreciated! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Naming components and hierarchy - Storybook - JS.ORG
We recommend naming components according to the file hierarchy. Single story hoisting. Stories which have no siblings (i.e. the component has only one...
Read more >
Story Hierarchy in Storybook 3.2. My first open source ...
It's an IDE for the React components. The Holy Grail of the dev — design communication ! It's a beam of light in...
Read more >
How can I create a hierarchy of EPIC , Feature, St...
The issuetypes come in three hierarchical flavors: Epic; Story, Task; sub-task. you can create new issue types that equate to level 2 or...
Read more >
Sub-story detection in Twitter with hierarchical Dirichlet ...
This paper proposes hierarchical Dirichlet processes (HDP), a probabilistic topic model, as an effective method for automatic sub-story detection. HDP can learn ...
Read more >
storybook/addon-chapters - npm package
Adds Substories/Hierarchy to React Storybook For more information about how to use this package see README · Security · Popularity · Maintenance ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found