#shared element transition with framer motion

1 messages · Page 1 of 1 (latest)

silk osprey
#

Hi everyone,
I'm using framer motion with remix, and trying to do a shared element transition

in index route, I added

export default function Index() {
  return (
    <main className="relative min-h-screen">
      <motion.div
        layoutId="logo"
        className="h-[400px] w-[400px] bg-[yellow]"
      ></motion.div>
    </main>
  );
}

and in about route, I added

export default function About() {
  return (
    <main className="relative min-h-screen">
      <motion.div
        layoutId="logo"
        className="h-[400px] w-[400px] bg-[yellow]"
      ></motion.div>
    </main>
  );
}

but no transition happens betwen the two elements that have layoutId="logo"

Does anyone have an idea why that is?

odd pond
#

I'm not too familiar with framer, but the motion.div in the parent route around the <Outlet /> component. This will most likely be in your root.tsx

silk osprey