API reference

Gridla publishes one package with three entry points. gridla is the framework-neutral core: pure functions over plain objects. gridla/interaction is the framework-neutral interaction layer: a controller, pointer gesture, transfer scope, and measurement on top of the core. gridla/react is the adapter: a provider, headless components, and hooks as thin bindings over the interaction layer.

These pages are generated from the JSDoc on the exported declarations by website/scripts/generate-api.ts. If something here is unclear, the fix belongs in the source comment.

gridla

ModuleExportsWhat it covers
ModelDEFAULT_CANVAS, DEFAULT_SNAP_DISTANCE, EMPTY_PADDING, GridAxis, GridBounds, GridCanvas, +19 moreThe public data model.
GeometryboundsFromCanvas, canPlaceItem, canvasesEqual, canvasInnerHeight, canvasInnerRect, canvasInnerWidth, +29 moreRectangle math, normalization, bounds and clamping, content extent, validation, and gap enforcement.
ProjectionapplyGap, ApplyGapOptions, preserveGaps, projectFloatingRect, ProjectionStrategy, projectItemsByChain, +6 moreRe-fit a layout to a different canvas size.
SolversedgeAlignedSlots, moveItem, MoveItemInput, NewGridItem, placeItem, PlaceItemInput, +10 moreMove, resize, place, and transfer.
NestedcompactLayout, CompactOptions, CompactResult, findContainerAt, FindContainerOptions, findFirstUnlockedAncestor, +20 moreTrees of layouts.
PresetsapplyPreset, LayoutPreset, PresetOptionsArrange items into rows, columns, or a grid that fills the canvas.
InstrumentationSolveStrategy, TraceCallback, TraceEventOptional tracing.

gridla/interaction

ModuleExportsWhat it covers
ControllercreateGridController, createGridStore, GridController, GridControllerOptions, GridStore, GridStoreListener, +3 morecreateGridController owns layout and gesture state for one canvas without any framework: a store to render from, imperative actions, the gesture API, projection onto the measured size, and controlled or uncontrolled layout sync.
Pointer gesturecreatePointerGesture, GRID_DATA, GridKeyboardEventLike, GridPointerEventLike, GridPointerGesture, GridPointerGestureDeps, +1 moreThe pointer and keyboard state machine over a minimal event shape: drag threshold, click versus drag, axis lock, snap bypass, resize edges, pointer capture, keyboard nudges.
Transfer scopecreateTransferScope, measurePreviewShift, TransferRegistration, TransferScopeMove items between controllers.
Style helpersGridRectStyle, GridResizeHandleStyle, GridResizeHandleStyleOptions, rectStyle, resizeHandleStyle, styleToTextThe inline geometry every adapter puts on items, preview outlines, and built-in resize handles.
TypesGridActions, GridChangeDetail, GridChangeReason, GridControllerConfig, GridGestureApi, GridInteraction, +3 moreState, action, gesture, and change types shared by the controller and every adapter.

gridla/react

ModuleExportsWhat it covers
ProviderapplyMeasuredSize, createStore, GridProvider, GridProviderProps, StoreGridProvider owns layout and gesture state for one canvas.
ComponentsGridCanvas, GridCanvasProps, GridItem, GridItemProps, GridItemRenderProps, GridPreviewOutline, +1 moreHeadless building blocks.
HooksGridContextValue, GridItemView, useElementSize, useGridActions, useGridContext, useGridInteractionState, +8 moreSubscribe to slices of provider state with minimal rerenders, read the rendered or visible layout, and reach the imperative actions.
InteractionGRID_DATA, GridPointerHandlers, useGridInteraction, UseGridInteractionOptionsPointer and keyboard orchestration for a canvas element you render yourself.
Transfer scopeGridTransferScopeMove items between providers.
TypesGridActions, GridChangeDetail, GridChangeReason, GridInteraction, GridInteractionMode, GridPreview, +2 moreState, action, and event types shared by the provider, hooks, and components.

gridla/dom

ModuleExportsWhat it covers
MountcreateTransferScope, GRID_DATA, GridHandle, GridItemRenderer, GridItemView, GridPositioning, +5 moremountGrid turns an element into a canvas: it creates and positions one element per item, wires pointer and keyboard input, measures the canvas, and reports committed layouts through a GridHandle.
TypesGridChangeDetail, GridChangeReason, GridInteraction, GridPreview, GridStateState and change types re-exported from the interaction layer for DOM consumers.

gridla/elements

ModuleExportsWhat it covers
ElementscreateTransferScope, defineGridlaElements, GridlaCanvasElement, GridlaCanvasEventMap, GridlaItemElement, GridlaLayoutChangeDetail, +3 moreCustom elements over gridla/dom: \<gridla-canvas\>, \<gridla-item\>, \<gridla-preview\>, and \<gridla-transfer-scope\>, registered with defineGridlaElements.
TypesGridChangeDetail, GridChangeReasonChange types re-exported from the interaction layer for custom element consumers.

gridla/vue

ModuleExportsWhat it covers
ProviderGRID_CONTEXT_KEY, GridContextValue, GridProvider, GridProviderEmits, GridProviderProps, TRANSFER_SCOPE_KEY, +2 moreGridProvider owns layout and gesture state for one canvas.
ComponentsGRID_DATA, GridCanvas, GridCanvasEmits, GridCanvasProps, GridItem, GridItemProps, +3 moreHeadless building blocks.
ComposablesGridSliceRef, selectItemView, useGridActions, useGridInteractionState, useGridItem, useGridItemView, +6 moreSubscribe to slices of provider state as shallow refs, read the rendered or visible layout, and reach the imperative actions.
Transfer scopeGridTransferScopeMove items between providers.
TypesGridActions, GridChangeDetail, GridChangeReason, GridInteraction, GridInteractionMode, GridItemView, +3 moreState, action, and event types shared by the provider, composables, and components.

gridla/solid

ModuleExportsWhat it covers
ProviderGridContextValue, GridProvider, GridProviderProps, useGridContext, useTransferScopeGridProvider owns layout and gesture state for one canvas.
ComponentscreateElement, ElementProps, GRID_DATA, GridCanvas, GridCanvasProps, GridItem, +5 moreHeadless building blocks written without a compiler.
PrimitivesGridItemView, MaybeAccessor, useGridActions, useGridInteractionState, useGridItem, useGridItemView, +6 moreAccessors over slices of provider state built with from() over the controller store, plus the imperative actions.
Transfer scopeGridTransferScopeMove items between providers.
TypesGridActions, GridChangeDetail, GridChangeReason, GridInteraction, GridInteractionMode, GridPreview, +2 moreState, action, and event types shared by the provider, primitives, and components.

gridla/angular

ModuleExportsWhat it covers
ProviderGRID_TRANSFER_SCOPE, GridController, GRIDLA_OPTIONS, GridProviderComponent, provideGridla, provideGridTransferScopeGridProviderComponent (\<gridla-provider\> or [gridlaProvider]) owns layout and gesture state for one canvas and provides an injectable GridController to its content.
ComponentsGRID_DATA, GridCanvasComponent, GridDragHandleDirective, GridItemDirective, GridPreviewOutlineComponent, GridResizeHandleDirective, +1 moreHeadless building blocks.
SignalsGridItemView, injectGridActions, injectGridController, injectGridItemView, injectGridStore, itemViewsEqual, +1 moreRead provider state as signals from any injection context: a slice of the state, one item as it should be painted, or the imperative actions.
TypesGridActions, GridChangeDetail, GridChangeReason, GridControllerConfig, GridInteraction, GridInteractionMode, +6 moreOutput payloads, application options, and the state, action, and change types shared with the other adapters.

gridla/svelte

ModuleExportsWhat it covers
ComponentsGridCanvas, GridItem, GridPreviewOutline, GridProvider, GridTransferScopeSvelte 5 components over the interaction layer.
RunescreateGridRunes, getGridContext, getTransferScopeContext, gridActions, gridItemView, gridLayout, +11 moreRune-style readers over the nearest provider, called during component initialization: gridStore selects a slice of state, gridItemView follows one item, gridLayout and gridSelection read the rendered layout and the selection, and gridActions reaches the imperative API.
TypesGRID_DATA, GridActions, GridCanvasProps, GridChangeDetail, GridChangeReason, GridControllerConfig, +10 moreComponent props, the item view passed to snippets, and the state, action, and change types shared with the other adapters.

gridla/qwik

ModuleExportsWhat it covers
ProviderGridContextId, GridContextValue, GridProvider, GridProviderProps, GridRuntime, TransferContextValue, +2 moreGridProvider owns layout and gesture state for one canvas.
ComponentsGRID_DATA, GridCanvas, GridCanvasProps, GridItem, GridItemProps, GridPreviewOutline, +1 moreHeadless building blocks.
HooksGridItemView, GridPositioning, selectItemView, useGridItemView, useGridRuntime, useGridState, +1 moreRead provider state as signals, derive one item's view, and reach the client-only runtime that holds the controller.
Transfer scopeGridTransferScopeMove items between providers.
TypesGridActions, GridChangeDetail, GridChangeReason, GridInteraction, GridInteractionMode, GridPreview, +1 moreState and change types re-exported from the interaction layer for Qwik consumers.