0.4.5 • Published 7 years ago

react-workspaces v0.4.5

Weekly downloads
21
License
MIT
Repository
github
Last release
7 years ago

react-workspace

A fusion between react-tabs and react-split-pane.

apr-30-2017 19-29-47

How to use

// A representation of the panel structure
const root = {
  axis: 'x',
  size: 50,
  children: [
    {
      size: 50,
      axis: 'y',
      children: [
        {},
        {}
      ]
    },
    {}
  ]
};


const components = {
  green: (
    <div style={{background: 'green', width: '100%', height: '100%'}}/>
  ),
  red: (
    <div style={{background: 'red', width: '100%', height: '100%'}}/>
  ),
  yellow: (
    <div style={{background: 'yellow', width: '100%', height: '100%'}}/>
  ),
  blue: (
    <div style={{background: 'blue', width: '100%', height: '100%'}}/>
  ),
};

const tabs = {
  // keys are paths of root,
  // values are representations of tabs
  'children[0].children[0]': ['green', 'red'], // if it is an array, then it will be a tab
  'children[0].children[1]': 'blue', // if not, just render the component itself
  'children[1]': ['yellow', 'red']
}

const workspace = (
  <Workspace onChange={(newRoot, newTabs) => {}} root={root} tabs={tabs} components={components}/>
);
0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago