mui / mui/material-ui

[tabs] Add the ability to modify a tab via context

Open
#43,902 3 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

scope: tabs type: new feature waiting for 👍
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Summary

Currently, MUI only allows retrieving the value of a tab through context, but it does not support the ability to modify or manage tabs dynamically via context. It would be beneficial to extend the functionality by adding the ability to modify the current tab value and other tab parameters through a context API.

Examples

An example implementation could reference the Material Design specification, which outlines the possibility of dynamic component management via contexts. This would enable the creation of more flexible and interactive interfaces where tabs can be changed based on different conditions in the application.

<TabContext value={value} setValue={setValue}>
   <Tabs>
      ...
   </Tabs>
   
   // Inside the component, you can get setValue through the context
   <TabPanel>
      ...
   </TabPanel> 
</TabContext >

Search keywords: tabs, context

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.