Skip to content

docs: add interactive Sandpack examples to guides - #246

Open
Braggiouy wants to merge 4 commits into
mainfrom
bruno/docs/interactive-guide-examples
Open

Braggiouy wants to merge 4 commits into
mainfrom
bruno/docs/interactive-guide-examples

Conversation

@Braggiouy

@Braggiouy Braggiouy commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

Overview

Adds interactive Sandpack examples to the guides, so readers can try each pattern with the arrow keys directly in the docs instead of only reading static snippets.

Changes

Each example sits right after the snippet it demonstrates, introduced by a short "Try it live" line explaining what to press and what to watch for.

Guides (new live example after the existing snippet):

  • quick-start.md: the basic focusable buttons from the guide.
  • focus-hierarchy.md: sibling containers, with hasFocusedChild highlighting the active sidebar.
  • focus-boundaries.md: a modal that traps focus with isFocusBoundary and returns focus to the trigger on close (autoRestoreFocus).
  • event-callbacks.md: onFocus / onEnterPress logged on screen, showing the latest extraProps.
  • programmatic-focus.md: a grid driven by setFocus / navigateByDirection, with getCurrentFocusKey shown live.
  • accessibility-labels.md: a panel showing exactly what onUtterText receives as focus moves between regions and leaves.
  • rtl-support.md: toggling updateRtl flips arrow-key navigation with no component changes.

Recipes (recipes.md): the static snippets are replaced by live, always-open examples (<Sandpack alwaysOpen>), so the code stays visible and editable:

  • Horizontal scrolling content row
  • Sidebar highlighting with hasFocusedChild
  • Modal focus trap
  • Seek bar with onArrowPress / onArrowRelease
  • Focusing a newly added item (doesFocusableExist + setFocus)
  • Saving and restoring focus between screens
  • Vertically scrolling page of rows

Other:

  • Focus colours in the existing static snippets updated to match the live examples.
  • Small cleanup in quick-start.md.

Notes

  • Docs only: no changes to the published packages, so no changeset is needed.
  • The examples rely on the docs site's <Sandpack> MDX component.

How to review

Open the affected guide pages in the docs preview, click into each example, and follow its "Try it live" instructions.

@Braggiouy Braggiouy self-assigned this Sep 7, 2026
@Braggiouy
Braggiouy requested a review from a team as a code owner September 7, 2026 14:57
@Braggiouy Braggiouy added the documentation Improvements or additions to documentation label Sep 7, 2026
@changeset-bot

changeset-bot Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e294086

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant