WarUI documentation

Multiple renderer adapters

experimental

Render the same state as a compact grid and plain text.

Live example

Expected behavior

Both panes receive the same frames. Switching a renderer keeps the current sort, selected rows and scroll position.

Source

const renderer = {
  role: 'grid',
  connect({ dispatchIntent }) { onSort = sort => dispatchIntent({ type: 'sort', sort }); },
  render(frame) { renderRows(frame.rows); },
};
await api.attachRenderer(renderer);
api.detachRenderer(renderer);

API reference

GRID-A01-F11 API
KindNameTypeDescription
MethodattachRenderer—Connects an adapter and delivers the initial frame.
MethoddetachRenderer—Aborts that renderer’s connection and frees its resources.
TypeRenderFrame—Serializes visible rows, columns, focus and scroll as detached values.
TypeIntent—Requests a state change without exposing mutable core state.