Item Configuration
var layout = new GoldenLayout({
content: [{
type: 'component',
componentName: 'someName',
componentState: { some: 'value' },
type: 'react-component',
component: 'name of your component',
props: {},
content: [],
id: 'some id',
width: 30,
height: 30,
isClosable: true,
title: 'some title',
activeItemIndex: 1
}]
});
| argument | type | optional | default | description |
|---|
| type | String | false | - | The type of the item. Possible values are 'row', 'column', 'stack', 'component' and 'react-component' |
| content | Array | true | - | An array of configurations for items that will be created as children of this item |
| width | Number | true | - | The width of this item, relative to the other children of its parent in percent |
| height | Number | true | - | The height of this item, relative to the other children of its parent in percent |
| id | Mixed | true | - | A String or an Array of Strings. Used to retrieve the item using item.getItemsById() |
| isClosable | Boolean | true | true | Determines if the item is closable. If false, the x on the items tab will be hidden and container.close() will return false |
| title | String | true | componentName or '' | The title of the item as displayed on its tab and on popout windows |
| argument | type | optional | default | description |
|---|
| componentName | String | false | - | The name of the component as specified in layout.registerComponent. Mandatory if type is 'component' |
| componentState | Object | true | - | A serialisable object. Will be passed to the component constructor function and will be the value returned by container.getState(). |
| argument | type | optional | default | description |
|---|
| component | String | false | - | The name of the component as specified in layout.registerComponent. Mandatory if type is 'react-component' |
| props | Object | true | - | Properties that will be passed to the component and accessible using this.props |
| argument | type | optional | default | description |
|---|
| activeItemIndex | Number | true | 0 | The index of the initially selected tab |
Comments and Questions