-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
UI: Add external links to navigation #8047
Comments
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Is there a workaround to achieve this functionality now? Like hooking into the Storybook API somehow to redirect to an external page when a specific story is selected? |
This feature is especially important for design systems and documentation. Has the implementation already started @shilman? |
Nope, @fabian-hiller want to give it a try? |
Yes I want to take a look at it. Can you give me a hint in which files to search? |
Hello frens! @shilman Did this ever get any action? Looking to do this currently in our design system. |
Looking for a way to do this ideally |
Until someone finds the time to build this properly into Storybook, here is a HACK that works with Storybook 8 and React installed (regardless of the actual framework). Warning This is NOT a sustainable approach to the problem. It relies on CSS escape hatches that will likely break repeatedly and require maintenance as Storybook evolves. Please understand also that in the example below, CSS was hardcoded to match the default dark Storybook theme and must be adjusted. General idea
There are ways to do this better. https://storybook.js.org/docs/api/main-config/main-config-indexers will give us a much better way to create stories with much cleaner data for use in the sidebar label renderer. And of course the label renderer could be replaced by a proper implementation like the ones shilman suggested, should anyone have free time! Tip Make this work better: contribute a PR.
|
The left-hand navigation of storybook consists of links to stories, arranged hierarchically. The Storybook logo link is also configurable (as well as visually).
In 5.2, we added the ability to link to "documentation-only stories" which is markdown-based documentation that can be interspersed within your stories.
Let's also allow the user to embed links to other external resources in the same navigation tree.
One possible implementation
In
storiesOf
:In
CSF
:In
MDX
:The text was updated successfully, but these errors were encountered: