#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
| Module | Exports | What it covers |
|---|---|---|
| Model | DEFAULT_CANVAS, DEFAULT_SNAP_DISTANCE, EMPTY_PADDING, GridAxis, GridBounds, GridCanvas, +19 more | The public data model. |
| Geometry | boundsFromCanvas, canPlaceItem, canvasesEqual, canvasInnerHeight, canvasInnerRect, canvasInnerWidth, +29 more | Rectangle math, normalization, bounds and clamping, content extent, validation, and gap enforcement. |
| Projection | applyGap, ApplyGapOptions, preserveGaps, projectFloatingRect, ProjectionStrategy, projectItemsByChain, +6 more | Re-fit a layout to a different canvas size. |
| Solvers | edgeAlignedSlots, moveItem, MoveItemInput, NewGridItem, placeItem, PlaceItemInput, +10 more | Move, resize, place, and transfer. |
| Nested | compactLayout, CompactOptions, CompactResult, findContainerAt, FindContainerOptions, findFirstUnlockedAncestor, +20 more | Trees of layouts. |
| Presets | applyPreset, LayoutPreset, PresetOptions | Arrange items into rows, columns, or a grid that fills the canvas. |
| Instrumentation | SolveStrategy, TraceCallback, TraceEvent | Optional tracing. |
#gridla/interaction
| Module | Exports | What it covers |
|---|---|---|
| Controller | createGridController, createGridStore, GridController, GridControllerOptions, GridStore, GridStoreListener, +3 more | createGridController 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 gesture | createPointerGesture, GRID_DATA, GridKeyboardEventLike, GridPointerEventLike, GridPointerGesture, GridPointerGestureDeps, +1 more | The 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 scope | createTransferScope, measurePreviewShift, TransferRegistration, TransferScope | Move items between controllers. |
| Style helpers | GridRectStyle, GridResizeHandleStyle, GridResizeHandleStyleOptions, rectStyle, resizeHandleStyle, styleToText | The inline geometry every adapter puts on items, preview outlines, and built-in resize handles. |
| Types | GridActions, GridChangeDetail, GridChangeReason, GridControllerConfig, GridGestureApi, GridInteraction, +3 more | State, action, gesture, and change types shared by the controller and every adapter. |
#gridla/react
| Module | Exports | What it covers |
|---|---|---|
| Provider | applyMeasuredSize, createStore, GridProvider, GridProviderProps, Store | GridProvider owns layout and gesture state for one canvas. |
| Components | GridCanvas, GridCanvasProps, GridItem, GridItemProps, GridItemRenderProps, GridPreviewOutline, +1 more | Headless building blocks. |
| Hooks | GridContextValue, GridItemView, useElementSize, useGridActions, useGridContext, useGridInteractionState, +8 more | Subscribe to slices of provider state with minimal rerenders, read the rendered or visible layout, and reach the imperative actions. |
| Interaction | GRID_DATA, GridPointerHandlers, useGridInteraction, UseGridInteractionOptions | Pointer and keyboard orchestration for a canvas element you render yourself. |
| Transfer scope | GridTransferScope | Move items between providers. |
| Types | GridActions, GridChangeDetail, GridChangeReason, GridInteraction, GridInteractionMode, GridPreview, +2 more | State, action, and event types shared by the provider, hooks, and components. |
#gridla/dom
| Module | Exports | What it covers |
|---|---|---|
| Mount | createTransferScope, GRID_DATA, GridHandle, GridItemRenderer, GridItemView, GridPositioning, +5 more | mountGrid 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. |
| Types | GridChangeDetail, GridChangeReason, GridInteraction, GridPreview, GridState | State and change types re-exported from the interaction layer for DOM consumers. |
#gridla/elements
| Module | Exports | What it covers |
|---|---|---|
| Elements | createTransferScope, defineGridlaElements, GridlaCanvasElement, GridlaCanvasEventMap, GridlaItemElement, GridlaLayoutChangeDetail, +3 more | Custom elements over gridla/dom: \<gridla-canvas\>, \<gridla-item\>, \<gridla-preview\>, and \<gridla-transfer-scope\>, registered with defineGridlaElements. |
| Types | GridChangeDetail, GridChangeReason | Change types re-exported from the interaction layer for custom element consumers. |
#gridla/vue
| Module | Exports | What it covers |
|---|---|---|
| Provider | GRID_CONTEXT_KEY, GridContextValue, GridProvider, GridProviderEmits, GridProviderProps, TRANSFER_SCOPE_KEY, +2 more | GridProvider owns layout and gesture state for one canvas. |
| Components | GRID_DATA, GridCanvas, GridCanvasEmits, GridCanvasProps, GridItem, GridItemProps, +3 more | Headless building blocks. |
| Composables | GridSliceRef, selectItemView, useGridActions, useGridInteractionState, useGridItem, useGridItemView, +6 more | Subscribe to slices of provider state as shallow refs, read the rendered or visible layout, and reach the imperative actions. |
| Transfer scope | GridTransferScope | Move items between providers. |
| Types | GridActions, GridChangeDetail, GridChangeReason, GridInteraction, GridInteractionMode, GridItemView, +3 more | State, action, and event types shared by the provider, composables, and components. |
#gridla/solid
| Module | Exports | What it covers |
|---|---|---|
| Provider | GridContextValue, GridProvider, GridProviderProps, useGridContext, useTransferScope | GridProvider owns layout and gesture state for one canvas. |
| Components | createElement, ElementProps, GRID_DATA, GridCanvas, GridCanvasProps, GridItem, +5 more | Headless building blocks written without a compiler. |
| Primitives | GridItemView, MaybeAccessor, useGridActions, useGridInteractionState, useGridItem, useGridItemView, +6 more | Accessors over slices of provider state built with from() over the controller store, plus the imperative actions. |
| Transfer scope | GridTransferScope | Move items between providers. |
| Types | GridActions, GridChangeDetail, GridChangeReason, GridInteraction, GridInteractionMode, GridPreview, +2 more | State, action, and event types shared by the provider, primitives, and components. |
#gridla/angular
| Module | Exports | What it covers |
|---|---|---|
| Provider | GRID_TRANSFER_SCOPE, GridController, GRIDLA_OPTIONS, GridProviderComponent, provideGridla, provideGridTransferScope | GridProviderComponent (\<gridla-provider\> or [gridlaProvider]) owns layout and gesture state for one canvas and provides an injectable GridController to its content. |
| Components | GRID_DATA, GridCanvasComponent, GridDragHandleDirective, GridItemDirective, GridPreviewOutlineComponent, GridResizeHandleDirective, +1 more | Headless building blocks. |
| Signals | GridItemView, injectGridActions, injectGridController, injectGridItemView, injectGridStore, itemViewsEqual, +1 more | Read provider state as signals from any injection context: a slice of the state, one item as it should be painted, or the imperative actions. |
| Types | GridActions, GridChangeDetail, GridChangeReason, GridControllerConfig, GridInteraction, GridInteractionMode, +6 more | Output payloads, application options, and the state, action, and change types shared with the other adapters. |
#gridla/svelte
| Module | Exports | What it covers |
|---|---|---|
| Components | GridCanvas, GridItem, GridPreviewOutline, GridProvider, GridTransferScope | Svelte 5 components over the interaction layer. |
| Runes | createGridRunes, getGridContext, getTransferScopeContext, gridActions, gridItemView, gridLayout, +11 more | Rune-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. |
| Types | GRID_DATA, GridActions, GridCanvasProps, GridChangeDetail, GridChangeReason, GridControllerConfig, +10 more | Component props, the item view passed to snippets, and the state, action, and change types shared with the other adapters. |
#gridla/qwik
| Module | Exports | What it covers |
|---|---|---|
| Provider | GridContextId, GridContextValue, GridProvider, GridProviderProps, GridRuntime, TransferContextValue, +2 more | GridProvider owns layout and gesture state for one canvas. |
| Components | GRID_DATA, GridCanvas, GridCanvasProps, GridItem, GridItemProps, GridPreviewOutline, +1 more | Headless building blocks. |
| Hooks | GridItemView, GridPositioning, selectItemView, useGridItemView, useGridRuntime, useGridState, +1 more | Read provider state as signals, derive one item's view, and reach the client-only runtime that holds the controller. |
| Transfer scope | GridTransferScope | Move items between providers. |
| Types | GridActions, GridChangeDetail, GridChangeReason, GridInteraction, GridInteractionMode, GridPreview, +1 more | State and change types re-exported from the interaction layer for Qwik consumers. |