[Label] Support ref as prop and add optional indicator
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 70
- Forks
- 13
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 8
Description
Summary
Label is a custom semantic form label component with required field indicator support. Missing ref prop support and has accessibility gaps.
Improvements
1. Accept ref as a prop
Component uses plain function export and doesn't accept ref as a prop. Prevents parent components from accessing the DOM element.
5. Add optional indicator prop
InputField has optional?: boolean showing "(optional)" text. Label should have matching support for consistency.
6. Make aria-level configurable on Header
The header sub-component hardcodes aria-level={3}. Should be configurable.
Moved to Cross-Cutting Issues
The following items have been moved to cross-cutting issues that address them across all components:
- Accessibility baseline (#673)
- Add displayName (#676)
Files
packages/raystack/raystack/components/label/
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/raystack/raystack/components/label/ and compare the Label API with InputField's optional prop behavior. Verify how the component currently renders its ref and Header aria-level, then consider the work complete when ref forwarding, optional text, and configurable aria-level are supported consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- accessibility, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100