-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Reintroduce Hidden component #26408
Comments
@GDownes you don't need to specify all breakpoints, see https://github.com/mui-org/material-ui/pull/26348/files Does this clarify things? -<Hidden implementation="css" smDown><Button' /></Hidden>
+<Button sx={{ display: { xs: 'none', sm: 'flex' } }} /> See https://codesandbox.io/s/nifty-banzai-gb6co?file=/index.js |
@mnajdova Thanks for the quick reply: See: https://codesandbox.io/s/upbeat-rosalind-6ch0t?file=/index.js In this example I'd expect xs to also be hidden as I've marked a higher breakpoint as hidden but it shows |
@GDownes it works the other way around, the object in the sx breakpoints specifies up(), that's why you need to specify the lowest breakpoint (xs to be hidden), and the next breakpoint for which you want the component to be shown. On the example you've sent, change |
@mnajdova Thanks for the clarification. That makes sense, closing. I still think that Hidden should be deprecated more slowly. |
I have stopped listening to issues for the last 3 weeks and will likely continue going forward. I was planning to open the same issue when I realized it was already created. It seems that the removal of the My main concern is that the migration path is only fully available since v5, people on v4 don't have a smooth transition. I propose we introduce the component back but deprecated. cc @mui-org/core. |
Reintroduce the hidden component.
https://material-ui.com/components/hidden/
The removal of the hidden compatibility breaks backwards compatibility.
Currently the sx property makes it difficult to replicate the functionally of the hidden component.
I think it has been prematurely removed.
For example:
becomes,
Having to list all the breakpoints in the example above isn't ideal. Hidden supported this use case well.
The text was updated successfully, but these errors were encountered: