Repository navigation
feat(ui): add docs header toggle to preview components in RTL - #910
Open
AbramovychYurii wants to merge 2 commits into
Open
AbramovychYurii wants to merge 2 commits into
AbramovychYurii wants to merge 2 commits into
Conversation
|
@AbramovychYurii is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following up on my question in #892.
While fixing RTL stuff I kept switching
dirfrom the console, but that doesn't change Base UI behavior like arrow keys or the drawer swipe, since those come fromDirectionProvider. So I added a toggle next to the theme switch that does both and remembers the choice.A lot of people build apps in RTL languages like Arabic, Hebrew, or Persian, and they can already wrap their app and coss ui in RTL, but not everything works right there yet. With the toggle, they can see how each component behaves in RTL right in the docs, before shipping it.
Should make RTL bugs a lot easier to catch.
Preview:
Screen.Recording.2026-10-22.at.14.43.47.mov
How it works
<html dir>and wraps the site in Base UI'sDirectionProviderlocalStorage(direction, liketheme) and a tiny inline script restores it before paint, so there's no LTR flash on reloadactionsslot inSiteHeaderAlso fixed
The toggle caught its first bug: tab and segmented control indicators stayed in the old spot after switching direction until you clicked, since they only re-measure on resize. They now remount when the direction changes.
I'll keep looking for more RTL bugs and fixing them as I go.