Skip to content

Function: mountTileLayout() ​

ts
function mountTileLayout(target, initial): TileLayoutHandle;

Render a tiling into target (an element or a shadow root), without a framework: one absolutely positioned, clipped element per tile, holding the items you give it. Sized in percentages, so it scales with target's width. Returns a handle to update or remove it.

Tiles have data-cell-id, data-index, data-empty and data-boundary, as with the React and Vue components.

Parameters ​

ParameterType
targetElement | ShadowRoot
initialTileLayoutConfig

Returns ​

TileLayoutHandle

Hat tiling and isohedral tilings after Craig S. Kaplan's hatviz and Tactile (BSD 3-Clause).