Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Change landing page #30688

Open
WhiteTiburon opened this issue Feb 26, 2025 · 2 comments
Open

[Bug]: Change landing page #30688

WhiteTiburon opened this issue Feb 26, 2025 · 2 comments

Comments

@WhiteTiburon
Copy link

WhiteTiburon commented Feb 26, 2025

Describe the bug

I am not able to change the landing page of my storybook. I have tried everything I have found online. Is there a link to the documentation to do this? I'm on version 8.5.8

Reproduction link

NA

Reproduction steps

No response

System

npx storybook@latest info

Additional context

No response

@shilman
Copy link
Member

shilman commented Feb 28, 2025

Storybook shows the first story or documentation page by sort order:

https://storybook.js.org/docs/writing-stories/naming-components-and-hierarchy#sorting-stories

So you can create an MDX docs page and sort it to the top. Does that satisfy your use case?

@WhiteTiburon
Copy link
Author

WhiteTiburon commented Feb 28, 2025

Storybook shows the first story or documentation page by sort order:

https://storybook.js.org/docs/writing-stories/naming-components-and-hierarchy#sorting-stories

So you can create an MDX docs page and sort it to the top. Does that satisfy your use case?

Thanks, this solved my issue.

Solution:

storySort: (a, b) => {
        // Ensure 'get-started--docs' comes first
        if (a.id === 'get-started--docs') return -1; // a comes first
        if (b.id === 'get-started--docs') return 1;  // b comes first

        // Otherwise, perform a regular comparison
        return a.id.localeCompare(b.id, undefined, { numeric: true });
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants