Storybook: Addon-docs: Multi-component props tables on DocsPage

Created on 20 Aug 2019  路  6Comments  路  Source: storybookjs/storybook

Is your feature request related to a problem? Please describe.
For many of our composed components, my team uses exports such as import Card, { CardActions } from @team/project/Card;, but our stories are then only on the top level Card. This is not currently supported.

Describe the solution you'd like
.addParameters({ component: Card }) => .addParameters({ components: { Card, CardActions } })

Describe alternatives you've considered
The current alternative would probably be to use a dummy story that links to the top level from each of the sub-components

Are you able to assist bring the feature to reality?
Yes, but I would need some pointers

docs props feature request todo

Most helpful comment

All 6 comments

How would you feel about a primary component and an optional subComponents array?

@shilman I think that would be a great option! My only thought on it being an array vs object was related to naming of the prop tables. Would those only be based on display name, or should that be configurable?

I'm open to making it an object; that's a great idea. I first wanted to get buy-in on the idea that there can be a "primary" component for a page, and potentially other "auxiliary" components. It seems like this is the case, but I want to understand peoples' use cases to make sure.

We also have this issue, as use the component/subComponent pattern a lot, in our case with dot notation, e.g.

Grid & Grid.Item

An optional subComponent array would be perfect for our use case.

ZOMG!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.0-beta.9 containing PR #8931 that references this issue. Upgrade today to try it out!

You can find this prerelease on the @next NPM tag.

Was this page helpful?
0 / 5 - 0 ratings