opensourceui
GitHubTwitter/X
  1. Home
  2. Components
  3. Gallery
  4. Polaroid Image
Back to Gallery

Components / Gallery

Polaroid Image

Free Gallery React component — PolaroidImageCard. MIT licensed, copy-paste ready for Next.js and Tailwind CSS.

Classic white polaroid with photo, caption, and date — slight tilt that straightens on hover. Nostalgic without feeling like a filter preset.

Preview

Polaroid photo

Golden hour, Kolkata ☀

June, 2026

Setup

How to use

Free for personal and commercial use. No UI attribution required. Include the MIT copyright notice when copying component source into your project. Read the MIT license.

  1. 1

    Run in your terminal:

    $npm install clsx tailwind-merge lucide-react
  2. 2

    Copy lib/cn.ts below. Skip if you already have cn().

  3. 3

    Copy the code below and create components/gallery/polaroid-image-card.tsx in your project.

  4. 4

    Import and render:

    Example

    import { PolaroidImageCard } from "@/components/gallery/polaroid-image-card";

    <PolaroidImageCard image="/your-photo.jpg" imageAlt="Summer trip" caption="Goa, 2024" />

lib/cn.ts

1
2
3
4
5
6
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
 
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}

components/gallery/polaroid-image-card.tsx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import {
forwardRef,
type ComponentPropsWithoutRef,
type ReactNode,
} from "react";
import Image from "next/image";
 
import { cn } from "@/lib/cn";
 
export type PolaroidImageCardProps = Readonly<
{
image?: string;
imageAlt?: string;
caption?: string;
date?: string;
rotate?: boolean;
children?: ReactNode;
} & ComponentPropsWithoutRef<"div">
>;
 
// Production-ready Polaroid Image component — styled with Tailwind CSS.
export const PolaroidImageCard = forwardRef<
HTMLDivElement,
PolaroidImageCardProps
>(
(
{
className,
image = "/wallpaper-3.png",
imageAlt = "Polaroid photo",
caption = "Golden hour, Kolkata ☀",
date = "June, 2026",
rotate = true,
children,
...props
},
ref,
) => {
return (
<div
ref={ref}
data-slot="polaroid-image-card"
className={cn("group w-56", className)}
{...props}
>
<div
className={cn(
"bg-white p-3 pb-10 shadow-[0_8px_30px_rgba(0,0,0,0.12)] transition-transform duration-500 ease-out",
rotate ? "-rotate-2 group-hover:rotate-0" : "",
)}
>
{/* Image */}
<div className="relative aspect-square w-full overflow-hidden bg-neutral-100">
<Image
src={image}
alt={imageAlt}
fill
sizes="224px"
className="object-cover sepia-[0.15] transition-all duration-500 group-hover:sepia-0"
/>
</div>
 
{/* Caption */}
<p className="mt-4 text-center font-serif text-sm text-neutral-600 italic">
{caption}
</p>
 
{/* Date */}
<p className="mt-0.5 text-center font-mono text-[10px] text-neutral-400">
{date}
</p>
 
{/* Optional slot (future extension) */}
{children}
</div>
</div>
);
},
);
 
PolaroidImageCard.displayName = "PolaroidImageCard";
PreviousNext

On this

page

Jump to a section on this page.

  • lib/cn.ts
  • components/gallery/polaroid-image-card.tsx

Sponsor spot · demo preview

Logo

Your brand name

Your tagline or category

A short pitch about your product or service goes here. This is a preview of how sponsor cards will look in this sidebar.

Your call to action

This slot is available. Sponsor Opensource UI and reach developers browsing components every day.