Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set a custom title to a named-export Story

Tags:

storybook

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";
like image 878
coler-j Avatar asked Oct 24 '25 13:10

coler-j


1 Answers

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

StorybookJS Docs source

like image 152
bbruthbar Avatar answered Oct 28 '25 02:10

bbruthbar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!