Repository navigation
Deep linking for Tabs component via URL parameters #4378
Closed
oemueller
started this conversation in
Feature Requests
Replies: 1 comment
|
Thanks for the suggestion 🙌 This looks like a duplicate of #2649 so I'm going to close this one for now for maintenance purposes. Of course, feel free to upvote the other discussion and share any additional thoughts there. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What version of
starlightare you using?0.42.10
What is your idea?
We have the idea in our team to add deep-linking support for Tabs using URL parameters to store the active tab state (e.g., https://example.com?starlight-synced-tabs__xy=api).
When the page loads, if this URL parameter is present, it should override the default tab and the current value in localStorage to activate the specified tab. (in case the syncKey is configured).
To make this feature highly discoverable, it would be great to add a "Copy Link" button (like a link icon) next to the tab headers. Clicking this would copy the URL with the correct parameter appended for the currently active tab.
The button should be optionally.
Alternative: considering
history.replaceState()when clicking tab elements.Why is this feature necessary?
We've received feedback from users who want to share direct links to a specific open tab within the Tabs component. For example, if the first tab is a "CLI example" and the second is an "API example," a user currently cannot send a colleague a link that automatically opens to the "API example."
Do you have examples of this feature in other projects?
No response
Participation
All reactions