MudCheckBox, MudRadio, MudSwitch: Add or improve aria-label support#12591
Merged
danielchalmers merged 1 commit intoMudBlazor:devfrom Feb 4, 2026
Merged
MudCheckBox, MudRadio, MudSwitch: Add or improve aria-label support#12591danielchalmers merged 1 commit intoMudBlazor:devfrom
aria-label support#12591danielchalmers merged 1 commit intoMudBlazor:devfrom
Conversation
aria-label support
igotinfected
approved these changes
Feb 2, 2026
Member
igotinfected
left a comment
There was a problem hiding this comment.
LGTM! Only thing I noticed is that we have a mix of Behavior and Appearance category attributes for different aria properties in different components. IIRC those attributes are used to group properties together in the docs?
This was referenced Feb 11, 2026
Closed
This was referenced Feb 20, 2026
Closed
Open
This was referenced Feb 23, 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.
Refactored the
AriaLabelhandling inMudCheckBoxand extended it toMudRadioandMudSwitchfollowing ARIA best practices and MudBlazor code standards.Summary of Changes
MudCheckBoxRefactor:aria-labelledbyassignment fromOnInitializedin MudCheckBox.razor.cs.aria-labelledbyattribute assignment directly to the<input>element in MudCheckBox.razor.aria-hiddenwhen a customAriaLabelis provided, preventing redundant verbalization.MudRadioImplementation:AriaLabelparameter to MudRadio.razor.cs.<span>for the label and linked it to theinputviaaria-labelledby.aria-hiddento the visible label/content whenAriaLabelis set.MudSwitchImplementation:AriaLabelparameter to MudSwitch.razor.cs.aria-labelledbyandaria-hiddenpattern used in the other components.Testing:
Radio_AriaLabeltest in RadioTests.cs andSwitch_AriaLabeltest in SwitchTests.cs.All three components now consistently handle ARIA labels by declaring them in the Razor file and correctly managing visibility for screen readers.
Checklist: