Components

Generated by website/scripts/generate-api.ts from packages/gridla/src. Do not edit by hand; run bun run generate in website/.

Headless building blocks. <gridla-canvas> measures itself and wires input; [gridlaItem] positions one item and renders built-in resize handles; <gridla-preview-outline> shows where the active item will land; <gridla-transfer-scope> lets items move between providers.

import { GRID_DATA, GridCanvasComponent, GridDragHandleDirective, GridItemDirective, GridPreviewOutlineComponent, GridResizeHandleDirective, GridTransferScopeComponent } from 'gridla/angular'
ExportKindSummary
GRID_DATAconstData attributes the pointer gesture looks for on pointer down.
GridCanvasComponentcomponentThe element items are positioned in.
GridDragHandleDirectivecomponentMarks an element inside a [gridlaItem] as the surface that starts a move.
GridItemDirectivecomponentPositions one item inside \<gridla-canvas\>.
GridPreviewOutlineComponentcomponentA box where the active item will land when released.
GridResizeHandleDirectivecomponentMarks an element inside a [gridlaItem] as a resize handle for one edge: \<div gridlaResizeHandle="se"\>\</div\>.
GridTransferScopeComponentcomponentLets items move between every provider rendered inside it.

Components

GridCanvasComponent

component · angular/canvas.component.ts:27

The element items are positioned in. Measures itself, feeds the size to the controller, and wires pointer and keyboard handling. Renders with position: relative; give it a height (or let it follow the layout with responsive="false" on the provider). Server rendering: the element renders empty of gesture wiring and measures itself after the first client render.

export class GridCanvasComponent // selector: gridla-canvas
MemberTypeDescription
controllerGridController\<any\>The controller of the enclosing provider.
enabledInputSignalWithTransform\<boolean, unknown\>Set false to disable pointer-driven gestures. Default true.
tabIndexInputSignal\<number\>Keyboard focus order; the canvas is focusable so arrow keys can nudge. Default 0.
itemClickOutputEmitterRef\<string\>A press on an item that did not turn into a drag. Selection already happened on press.
deleteKeyOutputEmitterRef\<string\>Delete or Backspace pressed with an item selected.

GridDragHandleDirective

component · angular/item.directive.ts:117

Marks an element inside a [gridlaItem] as the surface that starts a move. Pair it with draggable="false" on the item so the rest of the item is inert. The bound value is optional and ignored.

export class GridDragHandleDirective // selector: [gridlaDragHandle]
MemberTypeDescription
itemGridItemDirectiveThe item this handle belongs to.

GridItemDirective

component · angular/item.directive.ts:25

Positions one item inside \<gridla-canvas\>. Headless: it sets geometry styles and data attributes on its host and leaves appearance to you. [gridlaItem] is the item id. With resizeEdges, built-in handles are appended to the host; gridlaResizeHandle and gridlaDragHandle mark your own instead.

export class GridItemDirective // selector: [gridlaItem]
MemberTypeDescription
idInputSignal\<string\>Id of the item in the layout.
draggableInputSignalWithTransform\<boolean, unknown\>true (default): the whole element is a drag surface. false: only elements marked with gridlaDragHandle start a move.
resizeEdgesInputSignal\<ReadonlyArray\<GridResizeEdge\>\>Edges to render built-in resize handles for. Default: none.
resizeHandleClass`InputSignal<string \undefined>`
positioning`InputSignal<"absolute" \"transform">`
followPointerInputSignalWithTransform\<boolean, unknown\>Render the cursor-tracked rect while dragging instead of the solved preview. Default true.
controllerGridController\<any\>The controller of the enclosing provider.
viewSignal\<GridItemView\>Everything needed to paint this item.
shownRectSignal\<GridRect\>The rectangle currently painted: the pointer-tracked rect during a move, else the solved one.

GridPreviewOutlineComponent

component · angular/preview-outline.component.ts:11

A box where the active item will land when released. Hidden (display: none) when no gesture is in progress. Style it through the data-gridla-preview attribute.

export class GridPreviewOutlineComponent // selector: gridla-preview-outline
MemberTypeDescription
positioning`InputSignal<"absolute" \"transform">`
rect`Signal<GridRect \null>`

GridResizeHandleDirective

component · angular/item.directive.ts:130

Marks an element inside a [gridlaItem] as a resize handle for one edge: \<div gridlaResizeHandle="se"\>\</div\>. Position and style it yourself.

export class GridResizeHandleDirective // selector: [gridlaResizeHandle]
MemberTypeDescription
edgeInputSignal\<GridResizeEdge\>The edge this handle resizes.
itemGridItemDirectiveThe item this handle belongs to.

GridTransferScopeComponent

component · angular/transfer-scope.component.ts:12

Lets items move between every provider rendered inside it. The pointer decides the target: the deepest registered canvas under the pointer that accepts the item previews the drop; releasing there commits it. Use it as an element (\<gridla-transfer-scope\>) or an attribute ([gridlaTransferScope]); it renders no box of its own.

class export class GridTransferScopeComponent // selector: gridla-transfer-scope, [gridlaTransferScope]

Constants

GRID_DATA

const · interaction/attributes.ts:6

Data attributes the pointer gesture looks for on pointer down. Adapters emit them on their elements: item carries the item id, dragHandle marks a surface that starts a move, resizeHandle plus edge mark a resize handle.

export const GRID_DATA: { readonly item: "data-gridla-item"; readonly dragHandle: "data-gridla-drag-handle"; readonly resizeHandle: "data-gridla-resize-handle"; readonly edge: "data-gridla-edge"; }