Beta Status

This library is still in early beta and the API is subject to change and may get daily breaking changes. The documentaton may not be up to date with the latest features and include missing or outdated information. You can always create an issue on GitHub or even better a pull request to fix the documentation or add new features.

API Reference

Public surface exported from motion-solid.

Components

  • motion - Proxy exposing motion.div, motion.svg, and all HTML/SVG tags
  • AnimatePresence - Enables exit animations
  • MotionConfig - Global defaults for transitions and reduced motion

Hooks

  • usePresence - Presence state plus safeToRemove callback for manual exit control
  • useIsPresent - Just the presence accessor
  • usePresenceData - Access the custom payload from AnimatePresence
  • useReducedMotion - System preference for reduced motion as a Solid accessor
  • useMotionConfig - Current MotionConfig context

Utilities

  • createDragControls - Programmatic drag controller
  • stagger - Helper for orchestrating variants (e.g., stagger(0.1, { from: "center" }))

Types

Common types: MotionProps, AnimatePresenceProps, MotionConfigProps.

Motion Solid re-exports types from motion-dom: Variant, Variants, Transition, etc.

Notes

CSS custom properties (--*) are supported in initial, animate, and exit targets.