You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
import{Meta,StoryObj}from'@storybook/react';constmeta={title: 'Components/Form/Input',component: Input,args: {// ... fill out},}satisfiesMeta<typeofInput>;exportdefaultmeta;typeStory=StoryObj<typeofmeta>;exportconstDisabled: Story={args: {disabled: true,},};// +100 more examples
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 the meta.title accordingly: 'Components/Form/Input/Regular Cases', and 'Components/Form/Input/Standard Cases',, etc. But at the end I still have meta.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 .mdx file 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
Manually creating .mdx files and adding custom code.
Don't hijack 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?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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.title
accordingly:'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
.mdx
file 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
.mdx
files 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