-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Copy link
Labels
phase / ready-to-goThis issue merged and will be included in the current milestone releaseThis issue merged and will be included in the current milestone releasetype / bugSomething isn't workingSomething isn't working
Milestone
Description
Component
Label
Is this a regression?
no
Describe the bug
The current Label component has accessibility issues and lacks proper semantic distinction between interactive and descriptive labels. We need to enhance it to:
- Fix accessibility warnings: Currently getting "No label associated with a form field" warnings because the component always renders as even when not associated with form controls.
- Add cursor pointer: Interactive labels should have
cursor: pointerstyling. - Support two variants: Interactive (clickable) vs Descriptive (non-clickable) labels.
Current Problems
- Accessibility Issues:
- Label component always renders as
<label>element - When used in
RadioGroup,ProgressBar,Ratecomponents, it's not associated with any form control - Browser dev tools show "No label associated with a form field" warnings
- Missing Visual Feedback:
- Interactive labels don't show cursor pointer
- No clear distinction between clickable and non-clickable labels
- Semantic Incorrectness:
- Using
<label>for descriptive text violates HTML semantics - Current
readOnlyprop tries to fix this withpointer-events: nonebut doesn't solve the semantic issue
To Reproduce
- Open RadioGroup or ProgressBar
- Click on the label
Expected behavior
The Label component should support two distinct variants:
1. Interactive Labels ( variant="interactive" ) ( default ):
- Renders as
<label>element - Has
cursor: pointerstyling - Wraps form controls (inputs, checkboxes, radios)
- Clicking the label text activates the associated form control
- Used in:
Checkbox,Radio,TextField
2. Descriptive Labels ( variant="descriptive" ):
- Renders as
<div>element - No cursor pointer
- Just descriptive text, not associated with form controls
- Used in:
RadioGroup(group label),ProgressBar,Rate,CheckboxGroup.
Screenshots
No response
Package version
3.0.0-next-8bad474-17102025
Desktop
No response
Smartphone
Exception or Error
Additional context
Benefits
✅ Fixes accessibility warnings
✅ Proper HTML semantics
✅ Clear visual distinction between label types
✅ Backward compatible
✅ Better developer experience with explicit intent
Metadata
Metadata
Assignees
Labels
phase / ready-to-goThis issue merged and will be included in the current milestone releaseThis issue merged and will be included in the current milestone releasetype / bugSomething isn't workingSomething isn't working