0.1.0 • Published 8 years ago

rci-sidebar v0.1.0

Weekly downloads
1
License
-
Repository
github
Last release
8 years ago

rci-sidebar


React RcSidebar Component

NPM version build status Test coverage gemnasium deps node version npm download

Browser Support

IEChromeFirefoxOperaSafari
IE 8+ ✔Chrome 31.0+ ✔Firefox 31.0+ ✔Opera 30.0+ ✔Safari 7.0+ ✔

Screenshots

Development

npm install
npm start

Example

http://localhost:8009/examples/

online example: http://react-component.github.io/rc-sidebar/

install

rci-sidebar

Usage

var RcSidebar = require('rci-sidebar');
var React = require('react');
React.render(<RcSidebar />, container);

API

props

Property nameTypeDefaultDescription
classNameString''additional css class of root dom node
prefixClsString'rci-sidebar'prefix class
childrenAnything React can rendern/aThe main content
sidebarStyleobject{}Inline styles.
contentStyleobject{}Inline styles.
overlayStyleobject{}Inline styles.
dragHandleStyleobject{}Inline styles.
sidebarAnything React can rendern/aThe sidebar content
onSetOpenfunctionn/aCallback called when the sidebar wants to change the open prop. Happens after sliding the sidebar and when the overlay is clicked when the sidebar is open.
dockedbooleanfalseIf the sidebar should be always visible
openbooleanfalseIf the sidebar should be open
transitionsbooleantrueIf transitions should be enabled
touchbooleantrueIf touch gestures should be enabled
touchHandleWidthnumber20Width in pixels you can start dragging from the edge when the sidebar is closed.
dragToggleDistancenumber30Distance the sidebar has to be dragged before it will open/close after it is released.
pullRightbooleanfalsePlace the sidebar on the right

change from https://github.com/balloob/react-sidebar

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

open coverage/ dir

License

rci-sidebar is released under the MIT license.