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
This is the public surface exported from motion-solid.
Components
motion: proxy that exposesmotion.div,motion.svg, and all other HTML/SVG tags.AnimatePresence: enables exit animations. See AnimatePresence.MotionConfig: global defaults for transitions and reduced motion. See MotionConfig.
Contexts
MotionStateContextanduseMotionState: access the internal motion state (advanced).MotionConfigContextanduseMotionConfig: access motion configuration.PresenceContext: internal presence context used by AnimatePresence.
Hooks
usePresence: presence state plus asafeToRemovecallback.useIsPresent: presence state only.usePresenceData: reads thecustompayload from AnimatePresence.useReducedMotion: accessprefers-reduced-motionas a Solid accessor.
Utilities
createMotionComponent: create a motion component for a specific tag.createMotionState: build a MotionState object (advanced).useAnimationState: low-level animation controller hook.useGestures: low-level gesture hook used by the motion component.createDragControls: programmatic drag controller.staggerandisStaggerFunction: helpers for orchestrating variants.motionKeys: list of props consumed by motion components.animationTypesandbuildAnimationTypeMotionValues: animation helpers.isSVGElementandisHTMLElement: element tag checks.
Types
Common types include MotionProps, MotionOptions, MotionState, MotionValues,
MotionGoals, MotionGesturesState, MotionVariantsState, AnimatePresenceProps,
and MotionConfigProps. Motion Solid also re-exports Motion types like Variant,
Variants, and Transition from motion-dom.
Notes
Low-level APIs are provided for advanced use cases and may change during the beta.