ReactHive

Morph Gallery

Galleries 4

About

A black and white photo grid that turns to colour on hover. Click a photo and it morphs from its place to fill the screen, corners arriving on different beats. Open, it's a carousel: each photo bends away as the next sweeps in, and closing sends the photo back to its own slot.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Morph Gallery to your project and fits it to your theme.

Code

How Morph Gallery is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { MorphGallery } from "@/components/ui/morph-gallery";

const settings = {
  tint: "#000000",
  duration: 1.1,
  spread: 0.6
};

const bright = [
  {
    "name": "orange-sunglasses",
    "title": "Citrus",
    "alt": "A person in red sunglasses and a green jacket against orange",
    "caption": "Editorial, spring issue",
    "width": 1440,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/3b/3bb078492f3e6b7b2e411adcb66efb67de1d868a71023567df7e49770caf2759.webp"
  },
  {
    "name": "green-dancer",
    "title": "Green Room",
    "alt": "A blurred dancer in white against a green backdrop",
    "caption": "Motion study",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/96/96534974eb49bb0e5a352f251a69da6a4b11a6c691eaa20df96e8c21b665e569.webp"
  },
  {
    "name": "pink-blazer",
    "title": "Pink Hour",
    "alt": "A person in a pink blazer against pink",
    "caption": "Editorial, colour stories",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/3c/3cbe946fb0d67e3ea99ee0c861b1f9a4257f181200234bd461298577e3902b20.webp"
  },
  {
    "name": "yellow-walk",
    "title": "Procession",
    "alt": "A figure in a yellow robe walking, caught in a multiple exposure against orange",
    "caption": "Motion study",
    "width": 1440,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/0a/0aabcb5a22e5bc67dcb561d7b544bd52d518d3040b2f6a45e348d2c77b7e92a0.webp"
  },
  {
    "name": "red-sky",
    "title": "High Noon",
    "alt": "A person in a red outfit against a clear blue sky",
    "caption": "Editorial, summer issue",
    "width": 1800,
    "height": 1221,
    "src": "https://cdn.21st.dev/assets/mirror/88/8817490ab1af62dc8becfbc2c122b30c678b995f1e1e6fc1011538899d2f64bf.webp"
  },
  {
    "name": "spinning-dress",
    "title": "Turn",
    "alt": "A dancer spinning in a swirling, colourful dress",
    "caption": "Motion study",
    "width": 1400,
    "height": 1337,
    "src": "https://cdn.21st.dev/assets/mirror/76/760a67b082183370900b6f059af09fa02a70e18893162ab7003fafddb6a6b968.webp"
  },
  {
    "name": "magenta-hands",
    "title": "Peekaboo",
    "alt": "A person peering through yellow-painted fingers against magenta",
    "caption": "Editorial, colour stories",
    "width": 1195,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/5e/5eea8fe53aa88dd9aba2e1cbcce10d5cb3b74462d4bc28d75f714c265cafbabf.webp"
  },
  {
    "name": "orange-dancers",
    "title": "Heat",
    "alt": "Blurred dancers moving through orange light",
    "caption": "Motion study",
    "width": 1800,
    "height": 1169,
    "src": "https://cdn.21st.dev/assets/mirror/56/568de028f92375c3a70e1ec1a3755c218f95e2a7813d5bd5580195da66bebea6.webp"
  },
  {
    "name": "yellow-jacket",
    "title": "Yellow",
    "alt": "A person in a yellow and black jacket in a yellow room",
    "caption": "Editorial, menswear",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/3e/3e9a39eb7c2d9ec200ae5c009a2556580e4447f25212ee08985792e6626ecb59.webp"
  },
  {
    "name": "stage-dancers",
    "title": "Encore",
    "alt": "Dancers on a dark stage dissolving into trails of pink and blue light",
    "caption": "Motion study",
    "width": 1800,
    "height": 1376,
    "src": "https://cdn.21st.dev/assets/mirror/a4/a46338d079106c75d677588e79e0c89dd6ed83bb1cef4e891d7d0f90eba522f6.webp"
  },
  {
    "name": "green-dress",
    "title": "Orchard",
    "alt": "A person in a green dress holding an apple",
    "caption": "Editorial, autumn issue",
    "width": 1350,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/da/da1c0eb311d45b394f85d1629b83535cacb1386044c497a9bc24d83544b7fadb.webp"
  },
  {
    "name": "violet-blur",
    "title": "Afterglow",
    "alt": "A blurred figure in violet and orange light",
    "caption": "Motion study",
    "width": 1800,
    "height": 1199,
    "src": "https://cdn.21st.dev/assets/mirror/a6/a692ef8f461284b6a292a85bb4c5c284d3cbb7cab8134417e9aeb3f31abf4cee.webp"
  },
  {
    "name": "pink-pair",
    "title": "Two of Us",
    "alt": "Two people in pink sleeves, side by side",
    "caption": "Editorial, colour stories",
    "width": 1350,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/fc/fc2d20e32a94b933a2ebfb333fbbf1ceddc0a12a59403244dfdf0c1789f385de.webp"
  },
  {
    "name": "neon-crowd",
    "title": "Night Market",
    "alt": "A crowd blurred into streaks under neon lights",
    "caption": "Motion study",
    "width": 1800,
    "height": 1199,
    "src": "https://cdn.21st.dev/assets/mirror/f7/f7855a5859c4f254cec2a6a8ce3313196276bd1996b50cdb011c137abc5e6774.webp"
  },
  {
    "name": "red-suit",
    "title": "Red Line",
    "alt": "A person in a red suit against a dark backdrop",
    "caption": "Editorial, tailoring",
    "width": 1201,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/a9/a9a19a4c073cd0d7098c51866a2a1e0f4caf67c042c38c4f47101b2d9e215568.webp"
  },
  {
    "name": "beach-blur",
    "title": "Tide",
    "alt": "A blurred figure in a bright swimsuit on a beach",
    "caption": "Motion study",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/b2/b2ac414c4abb2616d3e6aa5648bfd128dd69032ba412259a0ec170b792f7187f.webp"
  },
  {
    "name": "yellow-blossom",
    "title": "Bloom",
    "alt": "A close portrait framed by yellow blossom",
    "caption": "Editorial, beauty",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/56/5617db928d7b8ef766d82c958d9125b5b4528f7bbd01876b44c12e7a36881f72.webp"
  },
  {
    "name": "hair-flip",
    "title": "Flip",
    "alt": "A person tossing their hair, in sunglasses and a pink top",
    "caption": "Editorial, summer issue",
    "width": 1800,
    "height": 1199,
    "src": "https://cdn.21st.dev/assets/mirror/01/01896b2343d03e64c0525b155db049eb63dbba24bafb214b6dee6252b5965086.webp"
  },
  {
    "name": "blue-suit",
    "title": "Blue Note",
    "alt": "A person in a blue suit sitting on white sheets against teal",
    "caption": "Editorial, tailoring",
    "width": 1200,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/b2/b20736eb1c9511339d0a6dd78b1688b28479e964e741044a08c3dfa5aa7a7cb9.webp"
  },
  {
    "name": "orange-chair",
    "title": "Sit Still",
    "alt": "A person sitting on a wooden chair against orange",
    "caption": "Editorial, menswear",
    "width": 1201,
    "height": 1800,
    "src": "https://cdn.21st.dev/assets/mirror/57/5790842cde5e70321f83073b8ef3e199e7024456bbe26308f241794c8360b10c.webp"
  }
];

function DemoContent(props: Partial<typeof settings> = {}) {
  const v = { ...settings, ...props };
  return (
    <main className="min-h-svh bg-[#f4f3f0] px-[3vw] pt-[8vh] pb-[10vh] text-[#0c0c10]">
      <div className="mb-[6vh] flex flex-wrap items-end justify-between gap-6">
        <h1 className="text-[clamp(2.5rem,6vw,6rem)] leading-[0.95] font-medium tracking-[-0.04em]">Archive</h1>
        <p className="max-w-[22rem] text-[15px] leading-[22px] text-balance opacity-60">Hover for colour. Open a photo, then swipe or use the arrows to move through the set.</p>
      </div>
      <MorphGallery items={bright.slice(0, 12)} tint={String(v.tint)} duration={Number(v.duration)} spread={Number(v.spread)} />
    </main>
  );
}

/** The demo in its own colours, filling the frame. */
export default function Demo(props: Partial<typeof settings> = {}) {
  return (
    <div className="min-h-svh w-full" style={{ background: "#f4f3f0" }}>
      <DemoContent {...props} />
    </div>
  );
}

More by ReactHive

View all
  • Card Deal

    Card Deal

    288
  • Arc Gallery

    Arc Gallery

    193
  • Fluid Type

    Fluid Type

    173
  • Step Stack

    Step Stack

    119
  • Iris Scroll

    Iris Scroll

    93
  • Card Pack

    Card Pack

    73
  • Word Drum

    Word Drum

    58
  • Colour Wash Slider

    Colour Wash Slider

    49

More in Galleries

View all
  • Gallery Component

    Gallery Component

    48
  • Photo Deck

    Photo Deck

    80
  • Scattered About

    Scattered About

    78
  • Product Hover Showcase

    Product Hover Showcase

    120
  • Image Gallery

    Image Gallery

    97
  • Editorial Collage Hero

    Editorial Collage Hero

    529
  • About 3

    About 3

    459
  • Elastic Gallery

    Elastic Gallery

    1.2K