Skip to content

Is it possible to create a custom DocCardList that displays items from different sidebars? #10752

Answered by slorber
Devon-White asked this question in Q&A
Discussion options

You must be logged in to vote

You can use useDocsSidebar() to get access to the sidedar in which the current doc is.

If you need to access other sidebars of a given version (not just categories), the only way I can think of is using useDocsVersion().docsSidebars["apiSidebar"]

Once you get the sidebar, it's your responsibility to traverse it and find the category.items to pass as props to DocCardList.

Remember all these are undocumented APIs on which we may make breaking changes. The API may break however I don't think the feature will disappear so it's relatively safe to use.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Devon-White
Comment options

Answer selected by Devon-White
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants