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 exposingmotion.div,motion.svg, and all HTML/SVG tagsAnimatePresence- Enables exit animationsMotionConfig- Global defaults for transitions and reduced motion
Hooks
usePresence- Presence state plussafeToRemovecallback for manual exit controluseIsPresent- Just the presence accessorusePresenceData- Access thecustompayload from AnimatePresenceuseReducedMotion- System preference for reduced motion as a Solid accessoruseMotionConfig- Current MotionConfig context
Utilities
createDragControls- Programmatic drag controllerstagger- 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.