Dev Helpers
← Back

Linked gallery thumbnail

Place this file at components/LinkedGalleryThumbnail.tsx in an App Router project. Provide public/studio.jpg or pass your own image source.

Open this example in the interactive library

Source code

// components/LinkedGalleryThumbnail.tsx

import Link from "next/link";

import Image from "next/image";

export default function LinkedGalleryThumbnail({
  src = "/studio.jpg",
  alt = "Inside the studio",
}: { src?: string; alt?: string } = {}) {
  return (
    <Link href="/gallery" aria-label="Open gallery">
      <Image
        src={src}
        alt={alt}
        width={240}
        height={160}
        style={{ objectFit: "cover", maxWidth: "100%" }}
      />
    </Link>
  );
}