react-toolbox/components/drawer
the1900 843b88a311 solve #1444 and #1359. (#1587)
* update webpack config to make "Basic usage" work.

I use webpack version 2.6 and new configure syntax rather than 1.x.

When I follow the instruction on `readme.md`. It always failed on *Basic Usage* with the message below.
``` bash
ERROR in ./~/css-loader?{"modules":false,"importLoaders":1,"localIdentName":"[name]--[local]--[hash:base64:8]"}!./~/postcss-loader/lib!./~/react-toolbox/lib/button/theme.css
  Module build failed: Error: composition is only allowed when selector is single :local class name not in ".raised", ".raised" is weird
```

So I figured out what's wrong and update `reame.md` to notify others.

* edit multiple number.

According to docs, the width is larger than 320px and if the device is mobile than 280px. To follow this specification It should be 5, not 4.
2017-08-02 18:13:48 +02:00
..
Drawer.d.ts Restructure typescript definitions (#1114) 2017-01-18 08:37:37 +01:00
Drawer.js Importing PropTypes from prop-types rather than react (#1413) 2017-04-17 16:14:17 +02:00
config.css solve #1444 and #1359. (#1587) 2017-08-02 18:13:48 +02:00
index.d.ts Restructure typescript definitions (#1114) 2017-01-18 08:37:37 +01:00
index.js Update dependencies and linter (#1180) 2017-01-26 18:05:32 +01:00
readme.md Migrate styles to PostCSS (#666) 2017-01-05 02:42:18 +01:00
theme.css Fixes #1127 2017-01-18 10:56:03 +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>
    );
  }
}

If you want to provide a theme via context, the component key is RTDrawer.

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.
insideTree Boolean false If true the Drawer is rendered inside the normal tree.
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.
withOverlay String true If true display an Overlay that locks the scroll when the Drawer is active.

Theme

Name Description
active Used for the root class when the drawer is active.
content Used for the drawer content.
drawer Root class.
left Added to the root class when drawer is to the left.
right Added to the root class when drawer is to the right.
wrapper A wrapper class for the top of the root.