Provider
Generated by
website/scripts/generate-api.tsfrompackages/gridla/src. Do not edit by hand; runbun run generateinwebsite/.
GridProviderComponent (<gridla-provider> or [gridlaProvider]) owns layout and gesture state for one canvas and provides an injectable GridController to its content. provideGridla registers application-wide defaults.
Functions
provideGridla
Register application-wide defaults for every gridlaProvider: solver
options (gap, snapDistance, snap, onTrace) plus responsive,
dragThreshold, and keyboardStep. Add it to bootstrapApplication or a
route's providers. Optional: providers work without it.
provideGridTransferScope
Providers for a transfer scope. GridTransferScopeComponent uses this; add
it to a component's providers to make every gridlaProvider inside that
component share one scope without an extra element.
Components
GridProviderComponent
Owns layout state and gesture state for one canvas. Use it as an element
(\<gridla-provider\>) or as an attribute on any element ([gridlaProvider]);
it provides a GridController to everything inside. Place a
\<gridla-canvas\> inside it. Nested layouts are nested providers.
Controlled: bind [layout] and listen to (layoutChange), or use
[(layout)]. Uncontrolled: pass [defaultLayout]. Every SolveOptions
field is an input; [config] takes them as one object.
Classes
GridController
Injectable owner of one canvas: a createGridController handle from
gridla/interaction wrapped in signals. GridProviderComponent provides
one instance per provider and forwards its inputs; children inject it with
inject(GridController) (or the injectGrid* helpers) to read state and
call actions. Standalone use: add it to a component's providers and call
setOptions yourself.
Constants
GRID_TRANSFER_SCOPE
Injection token for the TransferScope a provider registers with.
GridTransferScopeComponent provides it; inject it optionally to
participate in transfers from custom code.
GRIDLA_OPTIONS
Injection token for the application-wide defaults registered with
provideGridla. Inject it to read the defaults; provide it directly when
provideGridla is not an option (for example inside a component's
providers array).