[v2]: fallback for tab choice (groupId) #2885
Labels
difficulty: starter
Issues that are starter difficulty level, e.g. minimal tweaking with a clear test plan.
feature
This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
mlh
Major League Hacking Fellowship
🚀 Feature
When setting
groupId
onTabs
, it switches the tab selection for all tabs in this group and also stores the state in localStorage which is great. However, if there is a tab where one option is missing and this option is the selected one by using another tabs object of the same group with more choices, it looks kind of weird if no tab is selected. (see Motivation below for a real-world example)Just falling back to the first
TabItem
would be one option. Alternatively, there could be a property forTabs
calledfallbackTab
or so which could referenceTabItem.value
. Yet another option would be to use the value ofTabs.defaultValue
.I would have opened a PR but I'm not sure which option the maintainers may prefer.
Have you read the Contributing Guidelines on issues?
y
Motivation
Example use case: You have a docs site where you show how to do things with UI, API and CLI. You are using tabs, so users can switch between UI, API and CLI. Some features however, are not available in the UI for example, i.e. there are tabs with all 3 options and some with only API and CLI.
Pitch
(Please explain why this feature should be implemented and how it would be used.)
The text was updated successfully, but these errors were encountered: