The title of the component you export in the
default export controls the name shown in the sidebar.
It is also possible to group related components in an expandable interface in order to help with Storybook organization. To do so, use the
/ as a separator:
By default the top-level grouping will be displayed as a “root” in the UI (the all-caps, non expandable grouping in the screenshot above). If you prefer, you can configure Storybook to not show roots.
We recommend naming components according to the file hierarchy.
By default, stories are sorted in the order in which they were imported. This can be overridden by adding
storySort to the
options parameters in your
The most powerful method of sorting is to provide a function to
storySort. Any custom sorting can be achieved with this method.
storySort can also accept a configuration object.
|method||String||Tells Storybook in which order the stories are displayed||No||Storybook configuration|
|order||Array||The stories to be shown, ordered by supplied name||No||Empty Array |
|locales||String||The locale required to be displayed||No||System locale|
To sort your stories alphabetically, set
'alphabetical' and optionally set the
locales string. To sort your stories using a custom list, use the
order array; stories that don't match an item in the
order list will appear after the items in the list.
order array can accept a nested array in order to sort 2nd-level story kinds. For example:
Which would result in this story ordering:
Note that the
order option is independent of the
method option; stories are sorted first by the
order array and then by either the
method: 'alphabetical' or the default
configure() import order.