react-toolbox/components/drawer
Javi Velasco b61619b6a3 Merge master and solve conflicts 2015-11-11 10:28:01 +01:00
..
_config.scss Extract some variables from drawer sass 2015-10-21 01:10:32 +02:00
index.jsx Pure drawer 2015-11-05 11:45:23 +01:00
readme.md Merge master and solve conflicts 2015-11-11 10:28:01 +01:00
style.scss Add a drawer panel with playground area 2015-10-30 00:49:46 +01:00

readme.md

Drawer

The navigation drawer slides in from the left. It is a common pattern found in Google apps and follows the keylines and metrics for lists.

import Drawer from 'react-toolbox/lib/drawer';

class DrawerTest extends React.Component {
  state = {
    active: false
  };
  
  handleToggle = () => {
    this.setState({active: !this.state.active});
  };

  render () {
    return (
      <div>
        <Button kind='raised' accent label='Show Drawer' onClick={this.handleToggle} />
        <Drawer active={this.state.active} onOverlayClick={this.handleToggle}>
          <h5>This is your Drawer.</h5>
          <p>You can embed any content you want, for example a Menu.</p>
        </Drawer>
      </div>
    );
  }
}

Properties

Name Type Default Description
active Boolean false If true, the drawer will be visible.
className String '' Sets a class to give customized styles to the drawer.
onOverlayClick Function Callback function to be invoked when the overlay is clicked.
type String left Type of drawer. It can be left or right to display the drawer on the left or right side of the screen.