Motion Blocks

Interaction

Flip Grid

A FLIP-powered grid that animates reordering and layout changes. Framework-agnostic Custom Elements.

  • gsap Preview of https://gsap.comGSAPAnimate anything. Silky-smooth performance.

Preview

GSAP FLIP grid — change columns or animation settings to see items smoothly transition between layout states.
Attributes

Installation

pnpm dlx motion-blocks add flip-grid

Usage

---import "@/components/motion-blocks/flip-grid-element.ts";import "@/components/motion-blocks/flip-grid-item-element.ts";--- <motion-flip-grid  columns="3"  duration="0.5"  ease="power2.inOut"  stagger="0"  gap="1rem"  class="w-full">  <div class="flip-grid-item h-32 bg-white rounded-lg p-4">Item 1</div>  <div class="flip-grid-item h-32 bg-slate-50 rounded-lg p-4">Item 2</div>  <div class="flip-grid-item h-32 bg-white rounded-lg p-4">Item 3</div>  <div class="flip-grid-item h-32 bg-slate-50 rounded-lg p-4">Item 4</div></motion-flip-grid>

API Reference

Attribute Type Default
columns Number of columns in the grid (0 for auto-layout). number 0
duration Animation duration in seconds. number 0.5
ease easing function for animations. string "power2.inOut"
stagger Stagger delay in seconds between item animations. number 0
gap CSS gap value between grid items. string ""