Skip to content

refactor(playground): use Docusaurus Tabs for the file tabs - #4901

Open
thetaPC wants to merge 3 commits into
framework-tabsfrom
playground-file-tabs
Open

thetaPC wants to merge 3 commits into
framework-tabsfrom
playground-file-tabs

Conversation

@thetaPC

@thetaPC thetaPC commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #4899.

The file tabs look the same, but the scroll arrows are gone: the tab bar now scrolls natively. That is the main thing to review, to decide whether we still want the arrows.

  • The playground's file tabs use Docusaurus Tabs and TabItem, and the custom PlaygroundTabs copied from pre-v3 Docusaurus is deleted. This drops the last use of the internal useScrollPositionBlocker.
  • Docusaurus tab labels are text only, so the file icons are now SVG files that CSS draws from a data-file-type attribute.
  • Every tab and toggle button shares one keyboard focus ring in the site's link color, replacing each browser's default ring. File tabs keep it clear of the bar's rounded corners and scroll fully into view when focused.

Behavior changes, both standard Docusaurus Tabs behavior:

  • Arrow keys move focus between file tabs and Enter selects one. Before, focusing a tab selected it.
  • Switching frameworks opens that framework's first file instead of the one last selected.

How to test

In light and dark mode, compared with the live site:

  1. Open the preview's Grid page and pick Angular in a playground. The file tabs look the same, with their icons, but have no scroll arrows.
  2. Narrow the window until the file tabs overflow, then scroll them sideways with a trackpad or Shift and the mouse wheel. They scroll natively.
  3. Press Tab until a file tab is focused, then use the arrow keys. Focus moves between files with a ring that isn't cut off on the first or last tab, the focused tab scrolls fully into view, and Enter opens the file.
  4. Open another file, then switch to React and back to Angular. The first file is open again.
  5. Click "Open in StackBlitz", the lightning bolt in the toolbar. Every file from the tabs arrives in StackBlitz, including the ones you didn't open.
  6. Open Play Store and press Tab until a tab is focused. It shows the same ring.

@thetaPC
thetaPC added this pull request to stack #4900 November 25, 2026 01:31
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ionic-docs Ready Ready Preview Nov 25, 2026 1:33am UTC

Request Review

return (
<PlaygroundTabs groupId={usageTarget} className="playground__tabs">
// Each framework has its own files, so remounting on a switch selects its first file.
<Tabs key={usageTarget} className="playground__tabs">

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching to Docusaurus Tabs drops the scroll arrows, so overflowing file tabs now only scroll natively: a trackpad swipe, Shift and the mouse wheel, or arrow keys once a tab is focused. A mouse user without a horizontal wheel has no visible cue that more tabs are hidden. Should we add the arrows back, or is native scrolling enough? It only matters for playgrounds with many files, such as Angular examples on a narrow window.

This branch was successfully deployed

1 active deployment
Preview — 420418e2 Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant