Socket
Socket
Sign inDemoInstall

react-dock

Package Overview
Dependencies
9
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-dock

Resizable dockable react component


Version published
Maintainers
2
Install size
1.53 MB
Created

Readme

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

Last updated on 07 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc