Give a title to an individual story

Viewed 34

How do you give a title value to an individual story in storybook? Seems like it should be storyname.title = 'value' but that doesn't work.

For example:

export default {
  title: "Root Component Title",
  component: SomeComponent,
};

export const SomeComponentVariant = () => <SetUpTwoFAContainer />;
// This title does not work
SomeComponentVariant.title = "Set Up Parent Container";
2 Answers

Looks like the answer is SomeComponentVariant.storyName

You can override the story name using SomeComponentVariant.storyName = '...' to match the component name.

StorybookJS Docs source

Related