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

[LeftNav] Make left nav more composable #631

Closed
TanTan-TT opened this issue May 11, 2015 · 7 comments
Closed

[LeftNav] Make left nav more composable #631

TanTan-TT opened this issue May 11, 2015 · 7 comments
Labels
component: menu This is the name of the generic UI component, not the React module!

Comments

@TanTan-TT
Copy link

I want to add some complex list in Navleft. Is there any workaround?

@CEC-JeffMcCloud
Copy link

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.

@iSuslov
Copy link

iSuslov commented May 15, 2015

This should be high priority feature. +1

@soda29
Copy link

soda29 commented Jun 1, 2015

Great example! Thank you!

@TanTan-TT
Copy link
Author

Thank you! @CEC-JeffMcCloud , But I think this feature should be in the component. So I would not close this issue.

@CEC-JeffMcCloud
Copy link

@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)

@hai-cea hai-cea changed the title Could NavLeft contain any components rather than only menu? [LeftNav] Make left nav more composable Jun 19, 2015
@hai-cea
Copy link
Member

hai-cea commented Jun 19, 2015

This is related to #27

@hai-cea
Copy link
Member

hai-cea commented Jun 19, 2015

Dupe of #413

@hai-cea hai-cea closed this as completed Jun 19, 2015
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 25, 2022
@zannager zannager added component: menu This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: menu This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

7 participants