-
-
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
[Layout] responsive-based visibility of items #6726
Comments
ImplementationAssuming the proposed solution above makes sense, I've been looking at implementation. It seems that while
|
The <Layout container>
<Layout item xs>
Left
</Layout>
<Layout item>
Right
</Layout>
</Layout> What about using a different property for that hide/show use case? |
I would rather not use
Oh, I like that solution! What about having a |
LOL, I just got your message - I was coding the Similar to |
I like the idea of having |
@rosskevin What I'm saying is that when using Still, what do you think of supporting both implementations? @stunaz A new component would provide more flexibility, similarly to what Bootstrap is doing, a hide/show logic can be needed independently of the Some other cool thing I have seen on my twitter feed yesterday. |
Actually, Bootstrap API is pretty smart:
No need for a Visible and Hidden component. We only need one of the two. So, which one is the most intuitive? I think that it's the one that breaks with the default behavior (visible), hence hidden. What about a
The second nice thing about this API is that you don't have to enable each screen size you want to show or hide, you will most of the time needs a single property switch to |
@oliviertassinari you right, never thought of that |
With regard to exposing it with
Other thoughts? |
Nice PR 👍. I have no idea what's best here, sorry I'm not good at naming things, I can't help. |
PR'd implementation. Watchers please look at the API exposed. |
Some stuff we could do to go further
|
FYI -
|
@rosskevin Hi, I wanted to know if this feature is already available to use on material-ui v1. Thanks! |
@andreacornaglia Yes, it's. You can find the docs here https://material-ui.com/layout/hidden/. |
How to programmatically set xsUp and xsDown in Hidden element? |
Problem description
Previous short discussion with @rogovdm and @oliviertassinari :
#5808 (comment)
I would like to revisit the idea of showing or hiding
<Layout item/>
based on the grid breakpoints. In my sample screenshot:lg
md
sm
xs
Code
As-is, I would expect that
<Layout item align='center' container lg>
would only show up on large screens, and would disappear on anything smaller. This doesn't occur though, all items remain visible.Proposed Solution
There could be many ways to tackle this, but we should first agree that the ^^example seems like an intuitive way to show items responsively.
xs
).xs md={false}
it will show onxs
and up, but not onmd
The text was updated successfully, but these errors were encountered: