Return to Notes

Mapping Framer Motion inside Astro Islands

2026-04-05 4 min read

The Intersection of Static and Kinetic

When pushing Next.js boundaries, you have absolute control over the window state because React owns the entire rendering pipeline. Astro behaves differently.

Astro builds entirely static HTML structures by default.

import React, { useState } from 'react';
import { motion } from 'framer-motion';

export function InteractiveIsland() {
  // Using pure framer logic inside an isolated component
  const [active, setActive] = useState(false);
  return <motion.div animate={{ scale: active ? 1.2 : 1 }} />
}

By ensuring you map client:load selectively, you prevent hydration overhead across the site while maintaining the high-end physics where they matter most.

Why not use generic CSS?

CSS keyframes struggle to calculate interruption. If a user removes their cursor halfway through an animation, CSS will typically snap or awkwardly reverse. Framer Motion utilizes real spring physics.

End Transmission.

Back to all notes