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

Sort stories alphabetically (question) #106

Open
KrisLau opened this issue Jun 18, 2021 · 2 comments
Open

Sort stories alphabetically (question) #106

KrisLau opened this issue Jun 18, 2021 · 2 comments

Comments

@KrisLau
Copy link

KrisLau commented Jun 18, 2021

I tried to sort the stories alphabetically so I added this code block but it didnt't seem to work.

addParameters({
  options: {
    storySort: {
      method: 'alphabetical',
    },
  },
});

Then I realized storybook-loader probably has its own sort method and I found #11 but I can't figure out how to set that. Right now it seems like my stories are being alphabetically using the file path instead of the story name:
image image

Is there a way for me to either:
Display the enclosing folders in the storybook hierarchy like this:

  • Atom
    • Banner
    • ButtonGradient
    • ...
  • Molecules
    • AnimatedHeader
    • ...

OR

Have them all display in alphabetical order of the story names in the root like this:

  • AnimatedHeader
  • Banner
  • ButtonGradient
  • ...
@Cookizza
Copy link

I'm wondering this too..

@KrisLau
Copy link
Author

KrisLau commented Aug 5, 2021

Just thought I'd add a bit more to this issue. I attempted using grouping in my stories as explained in the Storybook docs but that didn't seem to work. This is what i added to the end of my stories.js:

export default {
  title: 'Atoms/Banner',
};

I also tried changing the the kind of storiesOf from Banner to Atoms/Banner which didn't work either. The attempt:
storiesOf('Atoms/Banner', module).add('default', () => <Banner />);

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

No branches or pull requests

2 participants