rc-drawer

drawer component for react

rc-drawer

Example

http://react-component.github.io/drawer/examples/

Usage

import Drawer from 'rc-drawer';
import React from 'react';
import ReactDom from 'react-dom';

ReactDom.render(
  <Drawer>
    {menu children}
  </Drawer>
, mountNode);

Install

Browser Support

IE 10+ ✔Chrome 31.0+ ✔Firefox 31.0+ ✔Opera 30.0+ ✔Safari 7.0+ ✔

API

propstypedefaultdescription
classNamestringnull-
prefixClsstring'drawer'prefix class
wrapperClassNamestringnullwrapper class name
widthstring | numbernulldrawer content wrapper width, drawer level transition width
heightstring | numbernulldrawer content wrapper height, drawer level transition height
openbooleanfalseopen or close menu
defaultOpenbooleanfalsedefault open menu
handlerboolean | ReactElementtruetrue or false or ReactElement, default: <divclassName="drawer-handle"><i className="drawer-handle-icon" /></div>;
placementstringleftlefttoprightbottom
levelstring | arrayallWith the drawer level element. all/ null / className / id / tagName / array
levelMovenumber | array | funcnulllevel move value. default is drawer width
durationstring.3slevel animation duration
easestringcubic-bezier(0.78, 0.14, 0.15, 0.86)level animation timing function
getContainerstring | func | HTMLElementbodyReturn the mount node for Drawer. if is nulluse React.creactElement
showMaskbooleantruemask is show
maskClosablebooleantrueClicking on the mask (area outside the Drawer) to close the Drawer or not.
maskStyleCSSPropertiesnullmask style
onChangefuncnullchange callback(open)
afterVisibleChangefuncnulltransition end callback(open)
onClosefuncnullclose click function
onHandleClickfuncnulhandle icon click function
keyboardBooleantrueWhether support press esc to close

2.0 Rename onMaskClick-> onClose, add maskClosable.

Development

npm install
npm start

HomePage

https://github.com/ant-motion/drawer

Repository

https://github.com/ant-motion/drawer.git


上一篇:rc-slider
下一篇:rc-collapse

相关推荐

官方社区

扫码加入 JavaScript 社区