ReactHive

Satin

Component 3

About

A photo printed on satin that floats down onto the table. Press and hold to pinch the fabric: it gathers toward your fingers and lifts, the cloth folding into ridges that catch the light. Drag to pull it about; let go and it settles flat, the last ripples running to the edges.

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

Code

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

Usage.tsx

"use client";

import type { ReactNode } from "react";

import { Satin } from "@/components/ui/satin";

const settings = {
  gather: 0.6,
  sheen: 0.8
};

/* The demo's Google Fonts. In a Next.js app, use next/font/google instead. */
if (typeof document !== "undefined" && !document.getElementById("satin-fonts")) {
  const style = document.createElement("style");
  style.id = "satin-fonts";
  style.textContent = "@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:wght@400..900&family=Inter+Tight:wght@100..900&display=swap'); .rh-bodoni-moda { font-family: 'Bodoni Moda', serif; } .rh-inter-tight { font-family: 'Inter Tight', sans-serif; }";
  document.head.appendChild(style);
}

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"
  }
];

/** A gentle entrance: rises and fades in, a beat after `delay` seconds. */
function Rise({ children, delay = 0, className = "" }: { children: ReactNode; delay?: number; className?: string }) {
  return (
    <div className={className} style={{ animation: `rh-rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) ${delay}s both` }}>
      <style>{`@keyframes rh-rise { from { opacity: 0; transform: translateY(28px); } } @media (prefers-reduced-motion: reduce) { @keyframes rh-rise { from { opacity: 0; } } }`}</style>
      {children}
    </div>
  );
}

const display = { className: "rh-bodoni-moda", style: { fontFamily: "'Bodoni Moda', serif" } };
const type = { className: "rh-inter-tight", style: { fontFamily: "'Inter Tight', sans-serif" } };
const photo = bright.find((p) => p.name === "red-suit")!;

function DemoContent(props: Partial<typeof settings> = {}) {
  const v = { ...settings, ...props };
  return (
    <main className={`${type.className} grid min-h-svh items-center overflow-hidden bg-[#e4e2de] px-5 py-10 text-[#1c1a18] md:px-[5vw]`}>
      <div className="mx-auto grid w-full max-w-[72rem] items-center gap-6 md:grid-cols-[1fr_auto] md:gap-[6vw]">
        <div className="text-center md:text-left">
          <Rise>
            <h1 className={`${display.className} mx-auto max-w-[9ch] text-[clamp(2.75rem,6.5vw,6rem)] leading-[0.92] font-medium tracking-[-0.03em] md:mx-0`}>Printed on Silk Satin</h1>
          </Rise>
          <Rise delay={0.1}>
            <p className="mx-auto mt-5 max-w-[22rem] text-[16px] leading-[24px] text-[#1c1a18]/65 md:mx-0">The autumn campaign, as a scarf. Pinch the fabric and pull; let go and it falls flat.</p>
          </Rise>
        </div>
        {/* No fade here: the sheet's own entrance is dropping onto the table. */}
        <div className="mx-auto aspect-[4/5] w-[min(36rem,92vw)] md:h-[86svh] md:w-auto">
          <Satin src={photo.src} alt={photo.alt} gather={Number(v.gather)} sheen={Number(v.sheen)} />
        </div>
      </div>
    </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: "#e4e2de" }}>
      <DemoContent {...props} />
    </div>
  );
}

More by ReactHive

View all
  • Card Pack

    Card Pack

    7
  • Card Deal

    Card Deal

    6
  • Shoal

    Shoal

    6
  • Step Stack

    Step Stack

    5
  • Arc Gallery

    Arc Gallery

    3
  • Mercury Clock

    Mercury Clock

    2
  • Whirlwind

    Whirlwind

    2
  • Fluid Type

    Fluid Type