Add sync prop to <CodeGroup> to disable cross-instance tab synchronization #4249
viveralia
started this conversation in
Feature Requests
Replies: 0 comments
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.
-
Problem
When a page has multiple
<CodeGroup>instances with matching tab labels, switching a tab in one group automatically switches all others on the page. If the code blocks across groups have different content heights, this causes noticeable layout shifts — the page jumps as multiple containers resize simultaneously, often scrolling the user away from what they were reading.Where to reproduce
Fingerprint Docs
This page has several
<CodeGroup>instances with tabs like "NPM", "CDN", etc. Switching tabs in any one of them causes all others to switch too, producing a jarring scroll jump.Expected behavior
The
<Tabs>component already supports async={false}prop to disable cross-instance synchronization. The same prop should be available on<CodeGroup>, allowing authors to opt out of sync behavior on pages where the layout shift is disruptive.Why this matters
Migration guides and comparison pages naturally have many code groups showing before/after or step-by-step changes. These groups often have very different content sizes per tab, making the synchronized resizing especially disruptive. Being able to disable sync per
<CodeGroup>would keep the default behavior everywhere it works well while giving authors control on pages where it doesn't.Beta Was this translation helpful? Give feedback.
All reactions