elderfo / react-native-storybook-loader

An automatic story loader for react-native-storybooks
https://github.com/elderfo/react-native-storybook-loader
MIT License
299 stars 27 forks source link

Sort stories alphabetically (question) #106

Open KrisLau opened 3 years ago

KrisLau commented 3 years ago

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:

OR

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

Cookizza commented 2 years ago

I'm wondering this too..

KrisLau commented 2 years ago

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