-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Docs] Add an example on how to use Tabs inside an AppBar #3005
Conversation
What's the advantage of having |
The |
I for one didn't know we could do this, and I needed it in my app O.o Good example @oliviertassinari 👍 👍 |
Humm ok, didn't think about this one. Would it make more sense to use a tabbar property instead of children for this case? |
@oliviertassinari - makes sense. Perhaps the description could be more explicit? Leave it if you like and I can fix it up later. Once I finish the example descriptions for last few components, I'm going to circle back around and tidy up the descriptions for some of the components I did first, to be more in the style of the later ones that I wrote when I had got more into the swing of it. |
Just had to use Tabbar with an AppBar, and I was wondering why we should put the whole application inside the AppBar. Why not allow to disable the shadow of the AppBar instead? |
@cgestes you can (at least that's how I was doing it before @oliviertassinari posted this), but then you don't have the shadow under the tabs. |
`what's the correct solution then? If we include support for flexible area that scroll? |
I don't think either is necessarily more correct, it depends on use case and preference - you have that flexibility. Yes, you would need a root component, but your flexible space will presumably be nested in each Tab. |
How is this supposed to work with controlled tabs? The content area is below the appbar. How is it switched when the tabs are toggled?
Although this will not maintain state inside the tabcontent component. Would that work? Or whats the proposed solution? |
Your content goes inside each tab: http://www.material-ui.com/#/components/tabs (Controlled example). |
This results in the appbar expanding all behind the content, which is not the desired result. The appbar should only got until the tabs. |
@oliviertassinari is this example not still useful for the reasons you mentioned? (But perhaps expanded to include controlled content (like the Swipeable example you just pointed out?) to overcome @pke's issue. Perhaps we just wait for @igorbt and @newoga's improvements #1321 (comment). I think we can probably close #1817 (I'm making the assumption that @newoga's extension of #1321 supersedes it - I haven't look at the code for either.) |
@pke The |
I'm closing this PR. I'm not fully happy with the style hack I had to use. Let's wait #773 to be resolved. |
@mbrookes could you explain how you styled your solution? I would like to implement that in my app. |
@mbrookes wow, to be honest, I didn't think I'd get a response from a year old thread! Thank you very much! Looking at the code, it's just a styled Tab bar? No combination of app bar and tab bar? |
@mjsevilla AppBar is in the first file linked above. The bootstrap Navbar import there is legacy. This is MeteorChef base converted from bootstrap React to Material-UI, but looks like I missed a couple of bits. |
Here is the result:
This is also to illustrate what #3004 would break. cc @cgestes.
We should address #1817 at some point.