📖Browse Documentation▼

Item Configuration

Layout trees in Strelit UI Kit are composed of four node types: ‘row’, ‘column’, ‘stack’, and ‘component’.

import { LayoutConfig, ComponentItemConfig, StackItemConfig } from 'strelit-ui-kit';

const config: LayoutConfig = {
  root: {
    type: 'row',
    content: [
      {
        type: 'component',
        componentType: 'sourceViewer',
        title: 'Source Code',
        size: '60%',
        componentState: { filePath: '/src/main.ts' },
      } as ComponentItemConfig,
      {
        type: 'stack',
        size: '40%',
        activeItemIndex: 0,
        content: [
          {
            type: 'component',
            componentType: 'terminal',
            title: 'Build Terminal',
          },
          {
            type: 'component',
            componentType: 'telemetry',
            title: 'Performance',
          },
        ],
      } as StackItemConfig,
    ],
  },
};

Common Item Properties (ItemConfig)

argumenttypeoptionaldefaultdescription
type‘row’ | ‘column’ | ‘stack’ | ‘component’false-The structural type of the item.
idstringtrue‘’

Unique identifier for retrieving items via layout.findFirstComponentItemById(id) or item.getItemsById(id).

sizestringtrue-

The relative or fixed size of this item among siblings. Supports percentages (e.g. ‘40%’), pixels (e.g. ‘250px’), or fractional units (e.g. ‘2fr’).

minSizestringtrue-

Minimum size below which the item cannot be resized (e.g. ‘120px’).

isClosablebooleantruetrue

If false, the close button on the tab/header is omitted and cannot be closed by the user.

titlestringtrue‘’The label displayed on the tab header for component items.

Component Items (ComponentItemConfig)

argumenttypeoptionaldefaultdescription
componentTypeComponentType (string)false-

The registered component identifier matching a factory function registered via layout.registerComponentFactoryFunction().

componentStateSerializableValuetrueundefined

Any serializable object, string, number, or array passed to the component container upon mounting.

reorderEnabledbooleantruetrue

Whether this specific component tab can be dragged to reorder within or across stacks.

headerHeaderedItemConfigHeadertrueundefined

Custom item-level overrides for header controls (close, popout, minimise, maximise).

Stack Items (StackItemConfig)

argumenttypeoptionaldefaultdescription
contentComponentItemConfig[]false[]

The array of component items hosted within this tabbed stack. Note: Stacks cannot contain other stacks or rows/columns.

activeItemIndexnumbertrue0

0-based index of the component tab that is active and visible initially.

maximisedbooleantruefalse

Whether this stack starts in the maximised state filling the layout viewport.

Row and Column Items (RowOrColumnItemConfig)

argumenttypeoptionaldefaultdescription
type‘row’ | ‘column’false-

‘row’ splits items horizontally (left to right); ‘column’ splits items vertically (top to bottom).

contentItemConfig[]false[]

Array of child items (which can be rows, columns, stacks, or components).

Whether you are building complex multi-screen trading terminals, enterprise data workspaces, or migrating from legacy layout engines, our team and community are here to help.

Open an Issue on GitHub →