React-toolbox: Support for clipped and floating permanent navigation drawers

Created on 29 Dec 2016  路  2Comments  路  Source: react-toolbox/react-toolbox

The material guidelines describe three types on permanent navigation drawers (scroll down to 'Types of permanent navigation drawers'):

  • Full-height navigation drawer: Apps focused on information consumption that use a left-to-right hierarchy
  • Navigation drawer clipped under the app bar: Apps focused on productivity that require balance across the screen
  • Floating navigation drawer: Apps that require less hierarchy

I can implement the first type by using the pinned property on NavDrawer or Drawer. But I would like to use the second type (clipped under app bar), and I don't see an obvious way to do that using react-toolbox.

Most helpful comment

It is possible indeed but you need to use the new implementation under 2.0 beta. Here is how it would look:

screenshot 2017-01-16 10 26 57

And the code could like like:

import React from 'react';
import AppBar from '../components/app_bar';
import { Layout, Panel, NavDrawer } from '../components/layout';

const Root = () => (
  <Layout>
    <AppBar title="React Toolbox" fixed flat />

    <NavDrawer active pinned clipped>
      This is the content for the drawer
    </NavDrawer>

    <Panel>
      This is the content for panel
    </Panel>
  </Layout>
);

export default Root;

All 2 comments

It is possible indeed but you need to use the new implementation under 2.0 beta. Here is how it would look:

screenshot 2017-01-16 10 26 57

And the code could like like:

import React from 'react';
import AppBar from '../components/app_bar';
import { Layout, Panel, NavDrawer } from '../components/layout';

const Root = () => (
  <Layout>
    <AppBar title="React Toolbox" fixed flat />

    <NavDrawer active pinned clipped>
      This is the content for the drawer
    </NavDrawer>

    <Panel>
      This is the content for panel
    </Panel>
  </Layout>
);

export default Root;

I was able to work around this in 1.x by using a nested layout:

<Layout>
  <Panel>
    <MyAppBarComponent />
    <Layout>
      <NavDrawer pinned={true}>
        {'Nav content'}
      </NavDrawer>
      <Panel>
        {'Main content'}
      </Panel>
    </Layout>
  </Panel>
</Layout>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

fraenku picture fraenku  路  3Comments

thomasthiebaud picture thomasthiebaud  路  4Comments

dbrrt picture dbrrt  路  3Comments

MarcoWorms picture MarcoWorms  路  3Comments

L-u-k-e picture L-u-k-e  路  3Comments