WarUI documentation

DOM ownership contract

experimental

The grid owns its root, sets one attribute on the container and exposes toolbar, empty and footer slots.

Live example

Expected behavior

The overlay shows owned regions (solid) and consumer slots (dashed). A foreign node injected into the owned body triggers a warning and is removed on the next render. Slot content persists across re-renders.

Source

const dom = await mountGridDom(api, {
  container,
  classPrefix: 'demo-grid',
  label: 'Products',
});
dom.setSlot('toolbar', toolbarNode); // identity kept across renders
dom.getRootElement(); // role="grid", owned by the grid

API reference

GRID-A01-F21 API
KindNameTypeDescription
FunctionmountGridDom—Attaches the DOM renderer to a container.
Attributedata-wargrid-owned—Marks grid-owned nodes and the container.
MethodsetSlot—Fills the toolbar, empty or footer slot.
MethodgetRootElement—Returns the grid root element.
OptionclassPrefix—Scopes every class set by the grid.