react-toolbox/components/drawer
Keren Chandran cdd6ee5f05 Merge branch 'dev' of https://github.com/react-toolbox/react-toolbox into update-docs
# Conflicts:
#	components/autocomplete/readme.md
#	components/dropdown/readme.md
2016-04-06 20:50:12 -04:00
..
Drawer.jsx Use ClassNames in Drawer 2015-11-28 15:32:58 +01:00
_config.scss Added !default to all config values as per #424 2016-04-02 00:47:39 +02:00
index.js Remove jsx extension from imports in components 2015-11-28 20:24:46 +01:00
readme.md Fixed spacing on drawer readme 2016-03-25 10:16:59 -04:00
style.scss Replace `overflow-y: scroll` with `overflow-y: auto` 2015-12-19 14:08:30 +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 label='Show Drawer' raised accent 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.