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

rc-dock

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-dock

dock layout for react component

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.5K
decreased by-17.34%
Maintainers
1
Weekly downloads
 
Created
Source

Dock Layout for React Component

alt text

Examples

https://ticlo.github.io/rc-dock/examples/

Usage

rc-tabs

import DockLayout from 'rc-dock'

...

defaultLayout = {
  dockbox: {
    mode: 'horizontal',
    children: [
      {
        tabs: [
          {id: 'tab1', title: 'tab1', content: <div>Hello World</div>}
        ]
      }
    ]
  }
};

render() {
  return <DockLayout defaultLayout={defaultLayout}/>
}

defaultLayout types

DefaultLayout

PropertyTypeCommentsDefault
dockboxBoxDatamain dock boxrequired
floatboxBoxDatamain float box, children can only be PanelDataempty BoxData
groups{[key]: TabGroup}additional group information{}

BoxData

a box is the layout element that contains other boxes or panels

PropertyTypeCommentsDefault
idstringunique idauto generated
sizenumbersize in dock group, used as width in h-box and used as height in v-box200
mode'horizontal' | 'vertical' | 'float'layout mode of the box
children(BoxData | PanelData)[]children boxes or panelsrequired

PanelData

a panel is a visiaul container with tabs button in the title bar

PropertyTypeCommentsDefault
idstringunique idauto generated
sizenumbersize in dock group, used as width in h-box and used as height in v-box200
groupstringname for the tab groupgroup of the first tab
tabsTabData[]children tabsrequired
panelLockPanelLockaddition information of a panel, this prevents the panel from being removed when there is no tab inside, a locked panel can not be moved to float layer either
xnumberx position, only used in float mode
ynumbery position, only used in float mode
znumberz index, only used in float mode0
wnumberwidth, only used in float mode
hnumberheight, only used in float mode

TabData

PropertyTypeCommentsDefault
idstringunique idrequired
titlestring | ReactElementtab titlerequired
contentReactElement | (tab: TabData) => ReactElementtab contentrequired
closableboolwhether tab can be closedfalse
cachedboolcached tab will always reuse the react component thus allows the component to keep its internal statefalse
cacheContextReact Contextcached tab is disconnected with parent react component, if react context is needed in the cached tab, the context type need to be specified here
groupstringtabs with different tab group can not be put in same panel, more options for the group can be defined as TabGroup in DefaultLayout.groups

Keywords

FAQs

Package last updated on 01 Apr 2019

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