Listing skeleton
A placeholder shaped like a rental listing, with photo, title, location and price, and a shimmer across the image.
Settings
Code
import { motion } from "framer-motion";
interface StaySkeletonProps {
/** Segundos que tarda el brillo en cruzar la foto. */
speed?: number;
}
export default function StaySkeleton({
speed = 1.6,
}: StaySkeletonProps) {
return (
<div aria-busy="true" className="w-full max-w-64 space-y-3">
<div className="relative aspect-[4/3] overflow-hidden rounded-2xl bg-black/5 dark:bg-white/10">
<motion.div
className="absolute inset-0 bg-[linear-gradient(90deg,transparent,rgba(29,29,31,0.08),transparent)] bg-[length:200%_100%] dark:bg-[linear-gradient(90deg,transparent,rgba(245,245,247,0.08),transparent)]"
animate={{ backgroundPosition: ["200% 0", "-200% 0"] }}
transition={{ duration: speed, repeat: Infinity, ease: "linear" }}
/>
</div>
<div className="h-3 w-4/5 rounded-full bg-black/5 dark:bg-white/10" />
<div className="h-3 w-2/5 rounded-full bg-black/5 dark:bg-white/10" />
<div className="h-3 w-1/3 rounded-full bg-black/5 dark:bg-white/10" />
</div>
);
}
Prompt for AI
Paste it into ChatGPT, Claude or Cursor and it will adapt the block to your project with these settings, even if you don’t use React.
More in Loaders
Where to use it
Booking and marketplace sites live on grids of listings, and those photos take a moment to load. This skeleton reproduces the usual card of a holiday rental, a hotel or a flat for sale: a big image followed by lines for title, location and price. Fill a whole grid with them and the page keeps its shape.
Show as many skeletons as results you expect, not just one, so the layout doesn’t reflow later. The shimmer only runs over the photo on purpose; keeping the text lines still makes the grid calmer to look at.