Micro-interactions

Focus Grid

A five-tile bento where any tile you pick takes the large slot and the rest slide back into order around it.

Install

bun add motion clsx tailwind-merge

Then copy 2 files into your project:

  • components/registry/focus-grid/focus-grid.tsx
  • lib/utils.ts

Props

PropTypeDefaultDescription
gapnumber8Space between tiles.
radiusnumber16Corner radius of each tile.
stiffnessnumber260Spring stiffness — higher lands faster.
dampingnumber32Spring damping — lower overshoots and settles.
captionsbooleantrueShow the small label on the supporting tiles.
heroSide"left" | "right""left"Which edge the large slot sits against.

What It Demonstrates

Layout animation
When an element's size or position changes, it animates to the new spot instead of snapping.
Shared element transition
An element travels and transforms from one position into another, like a thumbnail expanding into a card.
Spring
Motion driven by physics (tension, mass, damping) rather than a set duration.
Stiffness / Tension
How strongly the spring pulls toward its target. Higher feels snappier.
Damping
How quickly a spring settles. Lower damping means more bounce and oscillation.

Related Components

Appears In