About
An interactive keepsake photo box with a frosted translucent sleeve, sliding Polaroid print tray, hover lift physics, and an accessible full-bleed print viewer modal.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds PhotoBox to your project and fits it to your theme.
Code
How PhotoBox is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import React from "react";
import { PhotoBox } from "@/components/ui/photo-box";
const settings = {
title: "写真箱",
subtitle: "Photo Box",
defaultOpen: false,
accentColor: "#F28C38",
theme: "auto",
};
const VALID_THEMES = ["auto", "light", "dark"] as const;
type ThemeOption = (typeof VALID_THEMES)[number];
export default function PhotoBoxDemo(props: Partial<typeof settings>) {
const config = {
...settings,
...props,
};
const theme: ThemeOption = VALID_THEMES.includes(config.theme as ThemeOption)
? (config.theme as ThemeOption)
: "auto";
const accentColor =
typeof config.accentColor === "string" &&
/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(config.accentColor.trim())
? config.accentColor.trim()
: "#F28C38";
const canvasBg =
theme === "light"
? "bg-[#F4F4F3]"
: theme === "dark"
? "bg-[#141413]"
: "bg-[#F4F4F3] dark:bg-[#141413]";
return (
<div
className={`flex min-h-[460px] w-full items-center justify-center p-8 transition-colors duration-300 ${canvasBg}`}
>
<PhotoBox
title={typeof config.title === "string" ? config.title : "写真箱"}
subtitle={
typeof config.subtitle === "string" ? config.subtitle : "Photo Box"
}
defaultOpen={Boolean(config.defaultOpen)}
accentColor={accentColor}
theme={theme}
/>
</div>
);
}













