-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[LeftNav] Make left nav more composable #631
Comments
I found a workaround for this. Specify an empty array for "menuItems", and specify your custom element for the "header" property. That custom element can contain any number or type of child elements (i.e. "header" is added to the LeftNav as its first child, above the menu items). Example - a set of Tabs... var header = (
<div>
<Tabs>
<Tab label="Tab 1">
<div style={{padding: '1em'}}>
<h2>Sample Tab</h2>
<p>
My tab 1.
</p>
</div>
</Tab>
<Tab label="Tab 2">
<div style={{padding: '1em'}}>
<h2>Sample Tab</h2>
<p>
My tab 2.
</p>
</div>
</Tab>
<Tab label="Tab 3">
<div style={{padding: '1em'}}>
<h2>Sample Tab</h2>
<p>
Put some buttons, custom menu, or any other elements here
</p>
</div>
</Tab>
</Tabs>
</div>
);
// ...... //
<LeftNav ref="leftNav" docked={false} header={header} menuItems={[]}/> P.S. - you can still specify some menuItems if you want. They'll will just appear beneath your "header" element(s). Hope that helps. |
This should be high priority feature. +1 |
Great example! Thank you! |
Thank you! @CEC-JeffMcCloud , But I think this feature should be in the component. So I would not close this issue. |
@TanTan-TT - I agree 100%. I think the LeftNav should be little more than a Paper element that slides in and out. It would simply accept child elements, just as the Paper element does. Material UI should leave it to the developer to put their own Menu component w/ MenuItems, etc inside of it. I don't think it's helpful to assume the LeftNav will only ever be a simple menu control. (IMHO) |
This is related to #27 |
Dupe of #413 |
I want to add some complex list in Navleft. Is there any workaround?
The text was updated successfully, but these errors were encountered: