Item Configuration

var layout = new GoldenLayout({
    content: [{
        //Non ReactJS
        type: 'component',
        componentName: 'someName',
        componentState: { some: 'value' },

        //ReactJS
        type: 'react-component',
        component: 'name of your component',
        props: {},

        //General
        content: [],
        id: 'some id',
        width: 30,
        height: 30,
        isClosable: true,
        title: 'some title',
        activeItemIndex: 1
    }]
});

 

General

argumenttypeoptionaldefaultdescription
typeStringfalse-The type of the item. Possible values are 'row', 'column', 'stack', 'component' and 'react-component'
contentArraytrue-An array of configurations for items that will be created as children of this item
widthNumbertrue-The width of this item, relative to the other children of its parent in percent
heightNumbertrue-The height of this item, relative to the other children of its parent in percent
idMixedtrue-A String or an Array of Strings. Used to retrieve the item using item.getItemsById()
isClosableBooleantruetrueDetermines if the item is closable. If false, the x on the items tab will be hidden and container.close() will return false
titleStringtruecomponentName or ''The title of the item as displayed on its tab and on popout windows

 

Components without ReactJS

argumenttypeoptionaldefaultdescription
componentNameStringfalse-The name of the component as specified in layout.registerComponent. Mandatory if type is 'component'
componentStateObjecttrue-A serialisable object. Will be passed to the component constructor function and will be the value returned by container.getState().

 

Components with ReactJS

argumenttypeoptionaldefaultdescription
componentStringfalse-The name of the component as specified in layout.registerComponent. Mandatory if type is 'react-component'
propsObjecttrue-Properties that will be passed to the component and accessible using this.props

 

Stack Specific

argumenttypeoptionaldefaultdescription
activeItemIndexNumbertrue0The index of the initially selected tab

Comments and Questions

comments powered by Disqus