[Toolbar] Move useToolbar from DemoToolbar in docs into project
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Summary
The toolbar on documentation pages is a working role="toolbar" with proper keyboard navigation implemented in DemoToolbar. Internally it uses a hook called useToolbar which exposes the needed functionality. Can that hook be moved to the real toolbar class so people using MUI can have access to it or have it integrated into the toolbar without needing to use a somewhat cumbersome hook? See example image for what I am talking about on a docs page
Examples
On https://mui.com/material-ui/react-button-group/
https://github.com/mui/material-ui/blob/master/docs/src/modules/components/DemoToolbar.js#L153
Motivation
Toolbar as is is not as accessible as it could be. It would be nice if it had the right role to be an accessible toolbar and followed the rules for keyboard navigation. This functionality is already available in the docs subproject so moving it to be included with toolbar is not too hard and gives people the ability to opt in to that behavior if they want/need it.
Search keywords: toolbar
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 with docs/src/modules/components/DemoToolbar.js#L153 and read how its useToolbar hook provides the toolbar role and keyboard navigation. Compare that behavior with the project’s real toolbar implementation, then determine whether the hook should be exposed or integrated; done means MUI users can opt into equivalent accessible toolbar behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- accessibility, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100