📖Browse Documentation▼

EventEmitter & Signals

on( eventName, callback )

argumenttypeoptionaldefaultdescription
eventNameStringfalse-The name of the event to subscribe to
callbackFunctionfalse-The listener callback function invoked when the event fires

Subscribes to an event on the emitter instance. In modern TypeScript Strelit UI Kit, callbacks use arrow functions or standard closure binding without requiring legacy context parameters.

off( eventName, callback )

argumenttypeoptionaldefaultdescription
eventNameStringfalse-The name of the event to unsubscribe from
callbackFunctionfalse-

The specific callback listener previously registered with on()

Removes the specified listener from the event. unbind is maintained as a backward-compatible alias for off.

emit( eventName, …args )

argumenttypeoptionaldefaultdescription
eventNameStringfalse-The name of the event to emit
…argsany[]true-Arguments passed to listeners

Notifies listeners of an event and passes arguments along. trigger is an alias for emit.

addEventListener( eventName, callback ) & removeEventListener( eventName, callback )

Standard Web-aligned aliases for on() and off().

emitBaseBubblingEvent( eventName )

Emits a hierarchical event that bubbles up the layout tree (from ComponentItem through parent Stack,RowOrColumn, up to the root layout). Receiving callbacks are passed an instance of EventEmitterBubblingEvent :

  • event.name: The string name of the event.

  • event.target: The original EventEmitter that initiated the bubbling event.

  • event.stopPropagation(): Prevents further bubbling up the layout tree hierarchy.

  • event.isPropagationStopped: Boolean indicating whether propagation was stopped.

EventHub & Multi-Window Sync

Each StrelitLayout instance manages an EventHub (accessible via layout.eventHub) that facilitates message passing across all detached popout windows (BrowserPopout instances) and the main window:

// Emit a custom message across all detached windows and the main layout
layout.eventHub.emitUserBroadcast('tickerUpdated', { symbol: 'AAPL', price: 185.5 });

// Listen for broadcast messages anywhere in the application
const handleBroadcast = (data) => {
  console.log('Received multi-window event:', data);
};
layout.eventHub.on('userBroadcast', handleBroadcast);

// Unsubscribe when component unmounts
layout.eventHub.off('userBroadcast', handleBroadcast);

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 →