Solid
gridla/solid is the Solid adapter. It is written with solid-js/h hyperscript, so it ships as plain JavaScript with no JSX transform of its own; your app can use JSX, hyperscript, or solid-js/html. The components own layout and gesture state, measure the canvas, bind pointer and keyboard input, and position items. Appearance is yours. It is a thin binding over gridla/interaction, the same layer the React adapter is built on, so behavior is identical across adapters.
Appearance is yours: see the styling guide for every data-gridla-* attribute, resize handle sizing, the preview outline, and a starter stylesheet.
Install
The adapter ships inside the gridla package as the gridla/solid subpath. solid-js (1.8 or later) is an optional peer dependency.
Minimal example
Give GridProvider a defaultLayout and it keeps the state for you. GridCanvas renders a div with position: relative; give it a height. GridItem positions one item with a transform and sets the data-gridla-* attributes for styling; resizeEdges adds built-in resize handles. GridPreviewOutline renders a box where the active item will land.
The same tree with hyperscript, for apps that skip the compiler:
Two hyperscript rules to keep in mind: solid-js/h treats a function prop with zero parameters as an accessor and calls it, so pass reactive values as () => value() and declare callbacks with their parameters (onCommit: (detail) => ...); and solid-js/h is a client runtime, so server rendering goes through createComponent (which compiled JSX emits for you; see Server rendering).
Styles use Solid's conventions: style takes an object with hyphenated property names and string values ({ height: '480px' }), and classes go through class.
Controlled and uncontrolled
Pass layout and onLayoutChange to keep the state yourself. The provider reads its props reactively: every accepted change is reported through the callback, and the next value of layout flows back into the controller without a remount.
The second callback argument is a GridChangeDetail with the reason (move, resize, place, remove, update, transfer, set), the itemId, and the solver strategy. onCommit fires with the same detail after every interactive commit. Uncontrolled providers (defaultLayout) still report every change, so persistence works the same way in both modes. See controlled state and persistence.
Nested layouts and transfers
A nested layout is a GridProvider rendered inside a GridItem. Wrap the providers in a GridTransferScope and items move between them: the pointer decides the target, the deepest canvas under it previews the drop, and releasing there commits it. onTransferOut fires on the source and onTransferIn on the target.
The render-function form of children receives the item's view accessor plus dragHandleProps and getResizeHandleProps(edge), for your own drag surface and resize chrome. With draggable={false} only elements carrying dragHandleProps start a move, which keeps presses inside the nested canvas from dragging the group. Set acceptTransfers to false, or to a predicate, on any provider that should not take drops.
Primitives
Every primitive returns an accessor that notifies only when its slice changes, built with from() over the controller store. Call them inside a provider.
useGridStore(selector, isEqual?) is the general form; useGridLayout, useGridVisibleLayout, useGridSourceLayout, useGridItem, useGridItemView, useGridInteractionState, useGridPreview, and useGridSelection are selectors over it. useGridActions returns the imperative actions (move, resize, place, remove, update, select, setLayout, cancel), which return false when the solver rejected the request.
Server rendering and SolidStart
The adapter touches no window or document at import time. On the server, GridCanvas and GridItem render through ssrElement and emit the authored layout: every item at its authored position and size, with the same data attributes as on the client. Measurement, projection, and input start in onMount, so the first client paint after hydration already uses the measured size. Nothing else is required in SolidStart; import from gridla/solid in a route component as you would any other component.
Hyperscript (solid-js/h) is a client runtime and cannot render on the server. Compiled JSX calls createComponent, which the adapter supports in both environments; if you compose the tree by hand for a server render, use createComponent from solid-js/web instead of h.
API
The full reference is generated from the source: Provider, Components, Primitives, Transfer scope, and Types. The demo app that drives the adapter's browser tests is published with this site under /adapters/solid/.