Beta Status
This library is still in early beta and the API is subject to change and may get daily breaking changes. If the docs and the package disagree, prefer the package and open an issue on GitHub or send a pull request with a fix.
Architecture / Caveats
motion-solid keeps the runtime thin: animation state lives in motion-dom, framework behavior is translated from motion/react, and the public API stays Solid-native.
Runtime Split
motion-domownsVisualElementstate, projection nodes, layout stacks, feature execution, and gesture primitives.motion-solidtranslates the framework layer:motion,AnimatePresence,LayoutGroup,MotionConfig, presence timing, layout timing, and SSR/hydration host wiring.- Local repo code stays focused on Solid-first prop handling, kebab-case style keys, variant helpers, docs demos, and helpers like
createDragControls().
Caveats
- Solid disposes exiting owners immediately. Exit and shared-layout handoff keep the DOM node, but the removed subtree is no longer reactively alive.
AnimatePresencesupportsmode="sync" | "wait" | "popLayout". The default inmotion-solidispopLayout.borderRadiusandboxShadowcorrection only work when those values are present on the projecting motion node throughstyle,initial,animate, orexit.- Layout-capable custom components must forward
refto a single DOM or SVG host. - Built-in
motion.*elements keep the same intrinsic host shape on the server and the client.
Hydration Note
- Child resolution and child-tree tracking stay inside the inner motion host boundary so layout invalidation can react to Solid control flow changes without recreating children from outer layout effects and breaking hydration.
Solid Conventions
- Public transform and style keys are kebab-case first:
scale-x,rotate-y,transform-perspective,origin-x. - CSS variables (
--*) pass through unchanged. - Use
layout="position"for text or wrappers that should move without being visually scaled.