Search

Back

Copy Link

Library

/

Free

/

94

3D

94

3D

Not loading? Preview

Made by

@frameroverrides

override

click

Override

3D

Copy

Override

Copied to Clipboard!

Instructions

  1. Add a frame around the frame you would like to be 3D

  2. Set overflow to ‘visible’

  3. Add another frame behind your frame to act as the background

  4. Apply the two overrides in the file (withFront, and withBack)

  5. Adjust the values as needed at the top of the code (especially X movement)

Code Preview

import type { ComponentType } from "react"
import { motion } from "framer-motion"

// 👇 These are your controls 👇

const rotation = 42 // spin value
const duration = 3 // duration
const x = 7 // x movement
const rotationX = 10 // x rotation
const easing = "easeInOut" // easing

export function withFront(Component): ComponentType {
    return (props) => {
        return (
            <Component
                {...props}
                as={motion.div}
                animate={{
                    rotateY: [rotation, -rotation, rotation],
                    x: [-x, x, -x],
                    rotateX: [-rotationX, rotationX, -rotationX],
                }}
                transition={{
                    duration: duration,
                    repeat: Infinity,
                    ease: easing,
                }}
            />
        )
    }
}
export function withBack(Component): ComponentType {
    return (props) => {
        return (
            <Component
                {...props}
                as={motion.div}
                animate={{
                    rotateY: [-rotation, rotation, -rotation],
                    x: [x, -x, x],
                    rotateX: [rotationX, -rotationX, rotationX],
                }}
                transition={{
                    duration: duration,
                    repeat: Infinity,
                    ease: easing,
                }}
            />
        )
    }
}

Terms of Use for Free Assets

By accessing and using this Framer Override Library, you agree to the following terms:

All code snippets provided are available for your personal and professional use. This includes personal websites, client projects, and other website projects in Framer. You are strictly prohibited from sharing, redistributing, selling these code snippets, or creating derivative works for resale or distribution. Unauthorized sharing, distribution, or selling of these code snippets is a breach of these terms and may result in termination of your access to this library, along with potential legal action.