mui / mui/material-ui

[Toolbar] Move useToolbar from DemoToolbar in docs into project

Open
#46,739 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component: Toolbar scope: app bar type: new feature waiting for 👍
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/
Image
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.