Allow virtual grouping via story names without creating new files #28879
donaldpipowitch
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.
Let's assume I have an existing file
input.stories.tsx. The basic structure looks like this:The file is working great, args control is running, docs page is generated just fine, everything is there. But >100 examples is hard to browse and navigate. Therefor I'd like to introduce some grouping.
Right now I'd probably introduce new files:
input-regular-cases.stories.tsx,input-special-cases.stories.tsx, etc. and customize themeta.titleaccordingly:'Components/Form/Input/Regular Cases',and'Components/Form/Input/Standard Cases',, etc. But at the end I still havemeta.component: Input, so my docs page gets duplicated and I get weird page titles ('Regular Cases', 'Standard Cases', ...).Of course I could customize all of this by manually creating a top level
.mdxfile and disabling docs in the other files. But I'd like to avoid this.Describe the solution you'd like
I found an old solution that I quite like: #151 (comment)
But it doesn't look like there is an open issue that actively tracks this. So I do it here. I'd just like to use Storybooks separator (
/) in Story names to achieve the result described from above without any other workarounds.Right now the separator is just included in the name. (Which might be what some people actually want. See second option in alternatives.)
Describe alternatives you've considered
.mdxfiles and adding custom code.name, but create a new propery (e.g.group: 'Standard Cases') <- Actually I'd even prefer this, but it might seem unnatural and increases the API surface. But it would at least be backwards compatible in case people want "/" in their names.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