react-native-storybook-loader icon indicating copy to clipboard operation
react-native-storybook-loader copied to clipboard

Sort stories alphabetically (question)

Open KrisLau opened this issue 3 years ago • 2 comments

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
  • ...

KrisLau avatar Jun 18 '21 13:06 KrisLau

I'm wondering this too..

Cookizza avatar Jul 21 '21 14:07 Cookizza

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 />);

KrisLau avatar Aug 05 '21 19:08 KrisLau