Framer Motion has become one of the most widely adopted animation libraries in the React ecosystem. Its intuitive API, layout-aware transitions, gesture support, and advanced features like shared-element animations make it a top choice for interactive interfaces. Instead of exploring features in theory, this article walks through real framer motion examples built by developers – each demonstrating a specific animation technique or UI pattern.
Table of contents
- What Is Framer?
- What Is Framer Motion?
- Best Framer Motion Example
- Animate Presence
- Animate Presence: Stack 3D
- Applying aspectRatio with Framer Motion
- Element horizontal scroll progress
- Framer Motion usScrollConstraints
- Framer Motion 3D: LayoutOrthographicCamera
- Framer Motion 3D: Shapes button
- 3D Character Carousel with Framer Motion
- Animation Sequence Using Framer Motion
- Brilliant ad card
- Framer Motion staggerChildren
- Multistep Form Framer Motion
- App Store UI using React and Framer Motion
- Conclusion:
What Is Framer?

Framer is a powerful design platform that helps teams build interactive prototypes and production-ready websites without heavy coding. A Framer Motion example shows how it offers a visual canvas where designers create responsive layouts and refine interactions with ease.
Its flexible workflow supports rapid experimentation, allowing ideas to move from concept to polished design quickly. With its intuitive interface and real-time preview, Framer helps creators deliver smooth, high-quality digital experiences.
Features:
- Visual canvas
- Responsive design tools
- Interactive prototyping
- Ready-to-use components
- Code overrides
- Real-time preview
- Collaborative editing
- Publishing and hosting options
What Is Framer Motion?
Framer Motion helps you create smooth, modern animations for React interfaces with minimal effort. It streamlines complex animation tasks and allows teams to build visually engaging experiences that feel polished and responsive.
It has become a popular choice among developers because it blends ease of use with strong performance. Whether you design micro-interactions or full-page transitions, it supports you in delivering crisp, fluid UI animations.
Features:
- Declarative animations
- Layout animations
- Gesture-based interactions
- Shared layout transitions
- SVG and keyframe support
- Exit animations
- Motion variants
- Spring and inertia animations
Best Framer Motion Example
Framer Motion enhances interfaces with polished, fluid animations that feel natural to users. It helps you elevate UI experiences without forcing you to manage complex animation logic manually, which saves time during development.
You can integrate it seamlessly into React projects and keep full control over how elements move, respond, and transition. It supports design consistency and improves the overall visual appeal of any modern digital product.
Now, let’s check the best Framer Motion Examples.
Animate Presence
The example demonstrates how AnimatePresence to let a component run exit animations right before React removes it from the DOM. It toggles a piece of UI (a small motion.div) and uses exit to animate removal.
Technical Explanation:
- This example wraps conditional UI (cards, modals, list items, etc.) in an
AnimatePresencewrapper. When a component’s presence depends on a boolean or list state, adding/removing it triggers Framer Motion to animate its entry and exit; usinginitial,animate, andexitprops onmotioncomponents. - Each animated element must have a unique
key, so React + Framer Motion can track when it enters or leaves. On unmount, instead of disappearing immediately, the component runs its definedexitanimation; e.g., fading out, sliding away, and only after the animation ends does React remove it from the DOM. - This pattern works well for toggling modals, list items, page transitions, or any UI parts where a smooth entrance/exit enhances user experience.
What Does this Framer Motion Example Showcase?
- Handling React-tree changes cleanly: components animate out before they disappear, improving UI polish.
- Enter and exit animations for components when they mount/unmount.
- Using
AnimatePresencefrom Framer Motion to coordinate those animations. - Smooth toggling of UI; e.g., showing or hiding a card/modal or list, with fade/slide or custom exit/enter effects.
Animate Presence: Stack 3D
The “Stack 3D” example shows a draggable card interface where two cards are stacked, and when you drag and release the top card, it exits with a 3D-ish motion, while the next card animates into view.
It uses AnimatePresence to orchestrate unmount/mount animations plus motion values to create drag-based scale & rotation transforms.
Technical Explanation:
- The demo renders a stack of cards/panels and wraps their conditional rendering in
AnimatePresence. Each panel is amotionelement withinitial,animate, andexitvariants; when the list changes, Framer Motion runs the exit animation before the DOM node is removed, producing smooth departures. - Each animated element must have a unique
key, so React + Framer Motion can track when it enters or leaves. On unmount, instead of disappearing immediately, the component runs its definedexitanimation; e.g., fading out, sliding away, and only after the animation ends does React remove it from the DOM. - This pattern works well for toggling modals, list items, page transitions, or any UI parts where smooth entrance/exit enhances user experience
What This Framer Motion Example Showcase?
- Enter and exit animations for components when they mount/unmount.
- Using
AnimatePresencefrom Framer Motion to coordinate those animations. - Smooth toggling of UI; e.g. showing or hiding a card/modal or list, with fade/slide or custom exit/enter effects.
- Handling React-tree changes cleanly: components animate out before they disappear, improving UI polish.
Applying aspectRatio with Framer Motion
The example demonstrates how to animate changes to an element’s CSS aspect-ratio (and related layout changes) using Framer Motion’s layout animations and AnimatePresence. It shows smooth transitions when boxes change ratio/size instead of snapping abruptly.
Technical Explanation:
- This example demonstrates how to use the browser’s
aspect-ratioproperty (or an aspect-ratio wrapper) to control the intrinsic size of an element while still applying Framer Motion animations. With the aspect locked in CSS, animations such as scaling or layout transitions never distort the element’s proportions. - Each animated element is a
motioncomponent usinglayoutorlayoutIdso Framer Motion can smoothly animate between size and position changes. The CSS aspect container determines height based on width, allowing motion transforms to focus purely on movement and scaling instead of reshaping. - Media elements like images sit inside this container with
object-fit: cover, ensuring they fill the space naturally. When the layout shifts—such as switching from grid to detail view—Framer Motion interpolates the changes while the aspect ratio keeps everything visually stable and non-warping.
What This Framer Motion Example Showcases:
- Combining CSS
aspect-ratiowith Framer Motion, so boxes and media keep their proportions while animating. - Smooth layout transitions when elements resize or change position.
- Responsive scaling of images/containers without stretching, using
object-fitor wrapper patterns. - Practical patterns for animating grid items or media cards while preserving visual integrity.
Element horizontal scroll progress
The example demonstrates a compact Framer Motion pattern that combines AnimatePresence with keyed children to animate items in and out while preserving smooth layout transitions. It shows how variants, exit animations, and simple gesture/drag detection produce clean enter/exit motion for a small UI stack.
Technical Explanation:
- This example wraps conditionally rendered elements in a component that triggers animations on mount/unmount. When a piece of UI is added (e.g., via state toggling), it mounts and runs its “enter/initial → animate” animation. When it is removed, it first executes the defined “exit” animation, then unmounts — instead of disappearing instantly.
- Each animated element is a motion-enabled component with initial, animate, and exit props. On mount, it transitions into view; on unmount, it transitions out. This pattern improves user experience by smoothing transitions whenever components appear or disappear.
What Does This Framer Motion Example Showcase?
- Animated mounting and unmounting of components using a toggle or conditional render.
- Use of “enter” and “exit” animations when components appear or disappear.
- Smooth transitions like fade-in / fade-out (or slide) to make UI changes feel fluid.
- Clean handling of React conditional rendering or list changes with animation so the UI doesn’t abruptly jump.
Check out the best free Bootstrap admin template:

This free Material Design Dashboard is one of the best resource for developing engaging web apps.
Framer Motion usScrollConstraints
This Framer Motion example demonstrates a compact Framer Motion pattern that combines AnimatePresence, keyed children, and layout/gesture-driven motion to create smooth enter/exit transitions for a small interactive component.
It focuses on coordinating drag/trigger logic with variants so items animate out intentionally and replacements animate in cleanly.
Technical Explanation:
- This example wraps conditionally rendered elements inside an
AnimatePresencecontainer. When a piece of state toggles (e.g., show/hide), the corresponding component mounts or unmounts. Because ofAnimatePresence, when a component unmounts, it doesn’t immediately vanish; instead, it runs its definedexitanimation before React actually removes it from the DOM. - The animated elements are
motioncomponents withinitial,animateandexitprops set. On the mount, they transition frominitial→animate, and on unmount, they smoothly transition using theexitprops. This produces polished fade/slide (or custom) transitions that make UI toggles feel much smoother.
What Does this Framer Motion Example Showcase?
- Conditional rendering of UI components (e.g., cards/modals) with smooth entry and exit animations.
- Use of
AnimatePresenceto handle mounting and unmounting transitions; elements animate in when added, animate out before removal. - Clean coordination between React state changes and visual transitions, avoiding abrupt appear/disappear behavior.
- Simple but effective UI pattern for toggling views or modal-like components with animation.
Framer Motion 3D: LayoutOrthographicCamera
This Framer Motion example shows a compact Framer Motion pattern for a carousel-like card stack where cards transition with coordinated entrance and exit animations. It combines AnimatePresence, keyed children, and motion-driven transforms to produce smooth, interactive card swaps.
Technical Explanation:
- This example sets up a 3D scene using
@react-three/fiberand replaces a regular orthographic camera with Framer Motion’sLayoutOrthographicCamera. - Instead of manually controlling camera position and zoom, the camera reads the layout of the 3D content and animates to keep it nicely framed when the layout changes. As objects move, resize, or re-arrange (via layout animations), the camera smoothly interpolates to a new view.
- The 3D objects themselves are typically wrapped in motion components (e.g.
motion.mesh) withlayoutorlayoutIdturned on, so Framer Motion can calculate before/after bounds. - When state changes trigger a new layout, the
LayoutOrthographicCameraanimates its transform using springs or eased transitions, producing polished, cinematic camera moves driven purely by layout logic instead of imperative camera controls.
What Does This Framer Motion Example Showcase?
- Integration of Framer Motion 3D with
@react-three/fiberfor a 3D scene. - Use of
LayoutOrthographicCamerato automatically frame and animate between different layouts. - Smooth camera transitions (position/zoom) as the 3D layout changes.
- Layout-driven 3D motion: the camera reacts to content changes instead of hard-coded camera moves.
Framer Motion 3D: Shapes button
This example implements a stacked card interaction that uses AnimatePresence with keyed children to animate card exits and entrances. It pairs drag-driven motion values with variants so the top card gestures, exits offscreen, and the next card animates into place with a polished 3D feel.
Technical Explanation:
- The sandbox demonstrates a component-driven UI where cards or panels use
motionwrappers withlayout/layoutIdso Framer Motion computes before/after bounding boxes and animates size and position changes smoothly. It relies onvariantsto defineinitial,animate, andexitstates, letting the code reuse animation logic across elements. - For gestures, the example uses
useMotionValueto track drag values anduseTransformto derive responsive properties (scale, border radius, opacity) from that motion value. It combines those motion values with spring-based transitions, andAnimatePresenceso components animate out before React removes them, producing tactile, interruption-safe UI transitions.
What does this Framer Motion Example Showcase?
- Smooth layout and shared-element animations between list items and a detail view.
- Use of
motionvariants, andlayoutIdto morph elements between states. - Gesture-driven interactions with
useMotionValue/useTransformfor real-time feedback. - Springy transitions and
AnimatePresencefor polished mount/unmount behavior.
3D Character Carousel with Framer Motion
The example implements a 3D character carousel built with Framer Motion. It renders previous, current, and next character images and animates their positions and scale when you click the arrows.
AnimatePresence and variants coordinate enter/exit motions while the page background and title update with each character.
Technical Explanation:
- The demo stores an array of character objects and tracks an active index in the state. It maps that data to gallery items and uses conditional rendering so only the active item (and visible neighbors) render in focus.
AnimatePresencewraps the active card so Framer Motion runs theinitial→animateenter animation and theexitanimation before unmounting.- Each card is a
motionelement with variants that define position, scale, opacity, and translateY. The code uses spring-like transitions for a tactile feel and CSS for perspective and layering so side items appear blurred and slightly scaled down. - Navigation buttons update the active index; the component recomputes keys and variants so the library can smoothly interpolate layout and transform changes rather than abruptly swapping DOM nodes.
- Finally, the pen combines CSS gradients,
object-fitimages, and media queries to keep the visual intact on different screen sizes, while Framer Motion handles the animated framing and polish.
What Does This Framer Motion Example Showcase?
- A 3D-style character carousel built with React and Framer Motion.
- Animated entry/exit of the active card using
AnimatePresence. - Blurred, scaled neighbors and a focused center card to create depth.
- Prev/next controls and responsive tweaks so the gallery adapts across widths.
Animation Sequence Using Framer Motion
This example implements a 3D character carousel built with Framer Motion. It renders previous, current, and next character images and animates their positions and scale when you click the arrows. AnimatePresence and variants coordinate enter/exit motions while the page background and title update with each character.
Technical Explanation:
- The demo places a circular
motion.divand several target boxes, then measures each element’sgetBoundingClientRect()to compute center offsets. - It uses
useAnimation()to get an animation controller and run a sequence ofawait animation.start({...})calls, moving the circle to each computed position in order. - Because the animation is driven imperatively, the code controls exact timing and order without relying on declarative variants or layout interpolation. This pattern combines DOM measurement, animation controls, and async/await to create precise, choreographed movement across the page.
What Does This Framer Motion Example Showcase?
- Sequenced, imperative animations controlled via Framer Motion animation controls.
- Reading element positions at runtime and animating a mover to those coordinates.
- Chaining animations with async
animation.start()calls for deterministic flow. - A simple interactive run sequence: start → move to targets → finish.
Brilliant ad card
This Framer Motion example showcases an animated, interactive card using the Motion library (motion@latest). It combines CSS custom properties with JS-driven animations to create a playful eye, subtle hover motions, and button interactions that loop and respond to pointer events.
Technical Explanation:
- This demo defines a card layout in plain HTML/CSS and uses a vanilla motion library (not React) to animate CSS custom properties and transforms. It selects DOM elements (e.g. the “eye”, “eye-ball”, and a button) and uses
animate(...)calls to drive animations – such as moving the pupil inside the eye along X/Y, blinking via scaleY, and looping these movements indefinitely. - Animation runs by updating CSS variables like
--moveX,--moveY, and--hoverY, which feed into CSS transforms (translate, scale) or clipping paths (for the “squircle” shape). For the button, thehover(...)helper adds a scale-down on hover and resets on hover-out. - Because it’s not React-based, this example shows how animation controls and motion libraries can work directly with the DOM and CSS – useful when you want lightweight dynamic UI without full React overhead.
What Does This Framer Motion Example Showcase?
- A playful animated card UI using motion-based CSS variables and continuously looping animations.
- Use of a small “eye” inside a card that moves and blinks (via transforms and scaling) to create a subtle, alive effect.
Hover-effects– The button scales when hovered, giving interactive feedback.- Combining CSS styling with motion-based animations rather than React / JSX – showing that motion principles apply beyond React components.
Framer Motion staggerChildren
This framer motion example demonstrates a simple, staggered card grid. It renders a set of small app-like cards and uses staggerChildren so each card animates into place in sequence, producing a tidy cascading entrance effect.
Technical Explanation:
- This example renders a grid of cards inside a
motion.divand uses a set of defined variants to control how the group appears. - The parent container has an “initial” state (slightly shifted and transparent) and an “animate” state (normal position and full opacity). By specifying
staggerChildren, Framer Motion ensures each child card animates in sequence rather than all at once. - Each card is itself a
motion.divusing the same variants — when the parent triggers “animate,” all child cards follow, but each waits a small delay before starting. - The result: a cascading, staggered animation where cards slide and fade into view one after the other, creating a polished list-mounting effect.
What Does This Framer Motion Example Showcase?
- Staggered entrance animations for a list of cards using Framer Motion.
- Coordinated animation of multiple child elements using the
staggerChildrenproperty. - Smooth fade-in + slide-in effect when the card list mounts.
- A clean method to animate a group of elements together while preserving layout and timing dynamics.
Also check the shadcn/studio – A comprehensive library of highly customizable and ready-to-use shadcn blocks, shadcn components & shadcn templates.

Multistep Form Framer Motion
The example builds a compact interactive component using Framer Motion to choreograph entrance, exit, and gesture-driven animations. It focuses on coordinating variants, keyed children, and motion values so interactions feel tactile and polished.
Technical Explanation:
- The form tracks a
stepstate (integer) to know which step is active. Each step indicator is amotion.buttonthat usesvariantsto define different visual states – “inactive”, “active”, “complete”. Whenstepchanges occur, buttons animate to the appropriate variant. - When a step is marked “complete”, a check-mark SVG appears, and itself is animated: its path is drawn over time using a
motion.path, animating apathLengthfrom 0 → 1 to give a “drawing checkmark” effect. - Navigation buttons (“Next”, “Back”) update the step state. As state changes, Framer Motion takes care of smooth transitions between visual states without manual DOM manipulation.
- The code uses simple React components plus motion variants and transitions to coordinate UI and animation cleanly.
What Does This Framer Motion Example Showcase?
- A multi-step form UI where navigation between steps is animated.
- Animated updates on step indicators (buttons) – different states like “inactive”, “active”, “complete”.
- Animated drawing of a check mark when a step becomes “complete”.
- Smooth state-based transitions and user-driven navigation between steps.
App Store UI using React and Framer Motion
This Framer motion example demonstrates App Store–style UI built with React and Framer Motion that demonstrates card grids, shared-element transitions from a card to a detail view, drag-to-dismiss behavior for the detail, and smooth layout animations between states.
Technical Explanation:
- This example builds an App Store–style interface using React and Framer Motion. The UI starts with a grid of cards, and each card is wrapped in a
motion.divwith alayoutId. When a card is clicked, the route changes and the detail view mounts. - Because the card and the detail container share the same
layoutId, Framer Motion animates the element as it expands smoothly into a full-screen layout. - Inside the detail view, the component attaches vertical drag gestures using
drag="y". AuseMotionValuestores the drag distance, anduseTransformmaps that distance to visual properties like border radius and opacity. - As the user drags down, the card reacts in real time, and crossing a threshold triggers navigation back to the grid. Spring-based transitions add smoothness, while
AnimatePresencehandles clean mount and unmount animations.
What Does this Framer Motion Example Showcase?
- Shared / layout animations between list item and detail (cards morph into a full-screen view).
- Motion values (
useMotionValue) and derived values (useTransform) to drive gesture-based visual changes (e.g., scale, border radius) during drag. - Gesture handling + conditional navigation (drag beyond a threshold → close).
AnimatePresence/ exit animations so components enter/leave smoothly (older examples usedAnimateSharedLayout/ shared APIs). Note: this official example is known to use older Framer Motion APIs and has been discussed on the Framer Motion repo.
Conclusion:
These examples collectively demonstrate the range and power of Framer Motion. From simple fade animations to complex shared-element transitions, from 3D camera movements to animated forms and carousels, Framer Motion enables developers to build interfaces that feel dynamic, expressive, and highly interactive.
Whether you are designing product UI, building modern React applications, or exploring immersive 3D experiences, these examples offer practical patterns you can adapt and extend.
