API Overview
All the Framer and Framer Motion properties, events, and utilities.
Here’s an overview of all the API properties, user events, extra components, and utility functions,… with links to where they’re explained or used in the book.
For a demo of the visual and layout properties that you can actually animate, check Animatable Properties.
Animation properties
Every Frame and Motion element has this set of properties that make animations happen.
The components that are based on Framer’s <Frame>
, like <Scroll>
, <Page>
, and <Stack>
, will also have these properties.
Transition options
Some transition
settings you can only use with tween curves, others only with a spring, but adding repetitions or a delay is possible with both.
Orchestration options
You can orchestrate child animations by adding these settings to their parent’s transition
. Important: they’ll only work with variants.
Drag properties
Change the behavior of a draggable element with these properties.
Drag transition options
Releasing a draggable element starts an inertia animation, which you can tweak with these dragTransition
options.
Events
An overview of the user events a frame or motion element will react to. Plus also: the ‘while’ animation helpers.
You can also use common browser events. React will turn them into SyntheticEvents (which still contain a reference to the original event).
Frames and motion elements have a few more events that are triggered by animations:
Framer API | Motion API |
---|---|
onAnimationStart()
|
onAnimationStart()
|
onUpdate()
|
onUpdate()
|
onAnimationComplete()
|
onAnimationComplete()
|
Special components
Sometimes you need to wrap everything in a parent component that’ll know when to trigger an unmount animation: <AnimatePresence>
, or start layout animations: <AnimateSharedLayout>
.
MotionValues
Hooks and other functions to create, transform, or animate MotionValues.
The MotionValue API
Every MotionValue object has these methods. Use them to get its current value, change that value, or subscribe to value changes.
Utilities
These are the remaining Framer and Framer Motion utilities. The transform()
function is a version of the useTransform()
hook (see above) that works with common numeric values.
AnimationControls object
The useAnimation()
hook creates an AnimationControls object. These methods let you start and stop animations or instantly change the animated properties to a different value.