[TabPanel] add `disableGutters`
Open
@mnajdova is already working on this.
Since Aug 16, 2023.
package: lab
scope: tabs
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Duplicates
- I have searched the existing issues
Latest version
- I have tested the latest version
Summary 💡
Under my TabPanel's I display tables or lists, or some content that already includes padding.
It would be nice to be able to easily disable TabPanel padding with disableGutters property, like I can already do that on Toolbar or some other components.
Actually, so far, in 100% of the cases I wanted to remove the padding, so I would prefer disableGutters being true by default, but that would be a breaking change.
Workaround:
const myTheme = {
components: {
MuiTabPanel: {
styleOverrides: {
root: {
paddingLeft: 0,
paddingRight: 0
}
}
}
}
}
Examples 🌈
<TabContext value={tab}>
<Box sx={{ borderBottom: 1, borderColor: "divider" }}>
<TabList onChange={(_, newValue: "charts" | "table") => setTab(newValue)}>
<Tab label="Charts" value="charts" />
<Tab label="Table" value="table" />
</TabList>
</Box>
<TabPanel value="1">
<Charts />
</TabPanel>
<TabPanel value="2" disableGutters>
<Table /> ^^^^^^^^^^^^^^
</TabPanel>
</TabContext>
Motivation 🔦
Screenshots with and without padding to illustrate how I would benefit from this feature
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.
Assessment
This issue has not been assessed yet.