react-dock

Resizable dockable react component

react-dock downloads react-dock version react-dock license

react-dockSimilar Packages:

Npm Package Weekly Downloads Trend

3 Years
🌟 Show real-time usage chart on react-dock's README.md, just copy the code below.
## Usage Trend
[![Usage Trend of react-dock](https://npm-compare.com/img/npm-trend/THREE_YEARS/react-dock.png)](https://npm-compare.com/react-dock#timeRange=THREE_YEARS)

Cumulative GitHub Star Trend

🌟 Show GitHub stars trend chart on react-dock's README.md, just copy the code below.
## GitHub Stars Trend
[![GitHub Stars Trend of react-dock](https://npm-compare.com/img/github-trend/react-dock.png)](https://npm-compare.com/react-dock)

Stat Detail

Package
Downloads
Stars
Size
Issues
Publish
License
react-dock66,58314,33935.5 kB226a year agoMIT

README for react-dock

react-dock

Resizable dockable react component.

Demo

http://alexkuz.github.io/react-dock/demo/

Install

$ npm i -S react-dock

Example

render() {
  return (
    <Dock position='right' isVisible={this.state.isVisible}>
      {/* you can pass a function as a child here */}
      <div onClick={() => this.setState({ isVisible: !this.state.isVisible })}>X</div>
    </Dock>
  );
}

Dock Props

Prop NameDescription
positionSide to dock (left, right, top or bottom). Default is left.
fluidIf true, resize dock proportionally on window resize.
sizeSize of dock panel (width or height, depending on position). If this prop is set, Dock is considered as a controlled component, so you need to use onSizeChange to track dock resizing. Value is a fraction of window width/height, if fluid is true, or pixels otherwise
defaultSizeDefault size of dock panel (used for uncontrolled Dock component)
isVisibleIf true, dock is visible
dimModeIf none - content is not dimmed, if transparent - pointer events are disabled (so you can click through it), if opaque - click on dim area closes the dock. Default is opaque
durationAnimation duration. Should be synced with transition animation in style properties
dimStyleStyle for dim area
dockStyleStyle for dock
zIndexZ-index for wrapper
onVisibleChangeFires when Dock wants to change isVisible (when opaque dim is clicked, in particular)
onSizeChangeFires when Dock wants to change size
childrenDock content - react elements or function that returns an element. Function receives an object with these state values: { position, isResizing, size, isVisible }