[dev-v5] Add direction switch button in the header#4486
Merged
Conversation
- Update some styles to work with rtl mode -Fix Badge/CounterBadge rtl issues
|
✅ All tests passed successfully Details on your Workflow / Core Tests page. |
Summary - Unit Tests Code CoverageSummary
CoverageMicrosoft.FluentUI.AspNetCore.Components - 98.9%
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a header control in the demo app to toggle document direction (LTR/RTL) and updates badge/counter-badge positioning and examples to render correctly in RTL mode.
Changes:
- Added a
Blazor.theme.switchDirection()JS utility and wired it to a new header button in the demo layout. - Updated
FluentBadgeCSS positioning rules to correctly mirror “start/end” placement in RTL. - Refactored badge/counter-badge attached examples to use class-based icon rotations with RTL-specific overrides.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Core/Components/Badge/FluentBadge.razor.css | Adds RTL-aware positioning overrides for badge/counter-badge attachment points. |
| src/Core.Scripts/src/Utilities/Theme.ts | Introduces a JS function to toggle dir on the document root. |
| examples/Demo/FluentUI.Demo.Client/Layout/DemoMainLayout.razor.cs | Adds JS interop method to invoke Blazor.theme.switchDirection. |
| examples/Demo/FluentUI.Demo.Client/Layout/DemoMainLayout.razor | Adds a header button to switch LTR/RTL direction. |
| examples/Demo/FluentUI.Demo.Client/Documentation/Components/Badges/CounterBadge/Examples/CounterBadgeAttached.razor | Updates arrow icon styling to be RTL-aware via CSS classes. |
| examples/Demo/FluentUI.Demo.Client/Documentation/Components/Badges/Badge/Examples/BadgeAttached.razor | Updates arrow icon styling to be RTL-aware via CSS classes and tweaks grid spacing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dvoituron
requested changes
Jan 28, 2026
dvoituron
approved these changes
Jan 28, 2026
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.
Also udate some styles to work with rtl mode and fix Badge/CounterBadge rtl issues
The chosen direction is not (yet?) stored anywhere (cookie, storage) so after each page refresh the direction will be 'ltr' again. The direction is maintained when using the site navigation.