Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-dock

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dock

Resizable dockable react component

  • 0.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
48K
decreased by-15.69%
Maintainers
2
Weekly downloads
 
Created
Source

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 }

Keywords

FAQs

Package last updated on 07 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc