Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addon-docs: Multi-component props tables on DocsPage #7811

Closed
enagy27 opened this issue Aug 19, 2019 · 6 comments
Closed

Addon-docs: Multi-component props tables on DocsPage #7811

enagy27 opened this issue Aug 19, 2019 · 6 comments

Comments

@enagy27
Copy link
Contributor

enagy27 commented Aug 19, 2019

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

@enagy27 enagy27 changed the title Support multiple components when using addon-docs Support multiple components when using docs-mode Aug 19, 2019
@enagy27 enagy27 changed the title Support multiple components when using docs-mode Multiple components in docs-mode props tables Aug 19, 2019
@shilman shilman changed the title Multiple components in docs-mode props tables Addon-docs: Multiple components in props tables Aug 19, 2019
@shilman shilman added this to the 5.3.0 milestone Aug 19, 2019
@shilman shilman changed the title Addon-docs: Multiple components in props tables Addon-docs: Multiple components props tables on DocsPage Aug 19, 2019
@shilman shilman changed the title Addon-docs: Multiple components props tables on DocsPage Addon-docs: Multiple component props tables on DocsPage Aug 19, 2019
@shilman shilman changed the title Addon-docs: Multiple component props tables on DocsPage Addon-docs: Multi-component props tables on DocsPage Aug 19, 2019
@shilman
Copy link
Member

shilman commented Aug 26, 2019

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

@shilman shilman added the todo label Aug 26, 2019
@enagy27
Copy link
Contributor Author

enagy27 commented Aug 26, 2019

@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?

@shilman
Copy link
Member

shilman commented Aug 26, 2019

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.

@monospaced
Copy link

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.

@shilman
Copy link
Member

shilman commented Nov 19, 2019

Fixed in #8855 and released in https://github.com/storybookjs/storybook/releases/tag/v5.3.0-beta.2

🔥 🔥 🔥

@shilman
Copy link
Member

shilman commented Nov 26, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants