Typed subcomponent story factories (e.g. meta.ListItem.story) for compound components #34538
arasekinci
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
With
preview.meta({ component: List, subcomponents: { ListItem } }), meta.story() still infers args from List, not from ListItem. Stories that render only ListItem need casts (as never) or extra story files. subcomponents helps docs, but it does not provide a typed story API per subcomponent.Describe the solution you'd like
Expose small factories bound to each subcomponents entry so each story gets the correct prop types:
Here meta.ListItem.story would infer ListItem props, not List props.
Why it matters
Common pattern: one file documents a family (List + ListItem). Today we either split files, duplicate meta, or weaken types.
Describe alternatives you've considered
No response
Are you able to assist to bring the feature to reality?
yes, I can
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions