question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CSF: Story names should have intelligent defaults

See original GitHub issue

Is your feature request related to a problem? Please describe. It’s tedious to have to change the story name in CSF to a human readable one. e.g.

withSubtitle.story = {name: 'with subtitle'}

Describe the solution you’d like A clear and concise description of what you want to happen.

I’m wondering if the exported story names should follow a convention or be allowed to be configured globally in some way.

e.g. Having to do withSubtitle.story = {name: 'with subtitle'} seems automatable, and most likely what most users expect to end up as “with subtitle” in the left panel.

e.g. export const WithSubtitle would end up as “With Subtitle”.

Describe alternatives you’ve considered Just leaving it as is.

Are you able to assist bring the feature to reality? I can

Additional context N/A

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
shilmancommented, Aug 15, 2019

@kevinSuttle i think we should just allow users to specify a function like we do with storySort. we could make it default to:

displayName: (storyName) => kebabCase(storyName).replace(/-/g, ' ').upperFirst();
1reaction
shilmancommented, Oct 18, 2019

@patricklafrance MDX uses displayName under the hood, so you can’t use it in MDX. You should just be able to say <Story name="1 month visible">, so you’ve found a bug in the MDX handling: https://github.com/storybookjs/storybook/issues/8467

Read more comments on GitHub >

github_iconTop Results From Across the Web

Component Story Format (CSF) - Storybook
Named story exports​​ With CSF, every named export in the file represents a story object by default. We recommend that all export names...
Read more >
javascript - Storybook conversion to CSF - Stack Overflow
I'm wondering how can the following (stories that are generated from looping an array of objects) be converted to CSF? ps: my real...
Read more >
Install and Configure CSF: A Beginner-friendly Guide - Plesk
If you want to install CSF and understand CSF configuration, our guide will help you get started! Find all the details you need...
Read more >
10 Storybook Best Practices - Better Programming
One Storybook File Per Component. The story file should have: one Default story; a Playground story; and other stories that reflect a specific...
Read more >
storybook/addon-docs - npm
Out of the box, all your stories get a DocsPage . ... In contrast to DocsPage , which provides smart documentation out of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found