Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TabPanel] add disableGutters #38488

Open
2 tasks done
MonstraG opened this issue Aug 15, 2023 · 4 comments
Open
2 tasks done

[TabPanel] add disableGutters #38488

MonstraG opened this issue Aug 15, 2023 · 4 comments
Assignees
Labels
component: tabs This is the name of the generic UI component, not the React module! package: lab Specific to @mui/lab

Comments

@MonstraG
Copy link
Contributor

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

image

image

@MonstraG MonstraG added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 15, 2023
@zannager zannager added the component: tabs This is the name of the generic UI component, not the React module! label Aug 16, 2023
@mnajdova
Copy link
Member

Agree, it feels strange that this is the default. The component is in the lab so technically we could make breaking chages, but I will wait to see if this is an issue that more people hit.

@mnajdova mnajdova added package: lab Specific to @mui/lab and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 25, 2023
@ellinornk
Copy link

I've also come across this and would appreciate no padding or the disableGutters property!

@LauraLeGoff
Copy link

Same for me, it would be a nice addition and would allow easier control over the styling !

@SandersTDavid
Copy link

Same issue, would like to remove padding from tabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabs This is the name of the generic UI component, not the React module! package: lab Specific to @mui/lab
Projects
None yet
Development

No branches or pull requests

6 participants