A hero whose 3D-tilted phone mockup flattens and climbs up over the headline as the page scrolls. Theme-aware with a reduced-motion fallback.
Install
Add it to your project
Run this in a project set up for shadcn/ui. It writes the files and installs the npm packages.
First time: connect the Infinity UI registry
- Create a personal token on your Tokens page.
- Put it in
.env.localasINFINITYUI_TOKEN. - Add the registry to
components.json:
{
"registries": {
"@infinityui": {
"url": "https://infinityui.io/r/{name}.json",
"headers": {
"Authorization": "Bearer ${INFINITYUI_TOKEN}"
}
}
}
}Using Claude Code, Codex, Cursor, Lovable or v0? See CLI & MCP for a setup prompt.
npm packages it adds
- motion
Code
"use client";
import { PhoneScrollHero } from "@/registry/ruixenui/phone-scroll-hero";
const SCREEN_VIDEO =
"https://pub-940ccf6255b54fa799a9b01050e6c227.r2.dev/landscape-videos/old-money-lookbook.mp4";
export default function PhoneScrollHeroDemo() {
return (
<PhoneScrollHero
titleComponent={
<>
<p className="text-[0.7rem] font-medium uppercase tracking-[0.25em] text-muted-foreground">
Autumn / Winter lookbook
</p>
<h1 className="mt-3 text-3xl font-semibold text-foreground md:text-4xl">
The whole collection,
<br />
<span className="mt-1 block text-5xl font-bold leading-none tracking-tight md:text-[6rem]">
in your pocket
</span>
</h1>
</>
}
>
{/* Landscape source in a portrait screen — object-cover crops to the
centre of the frame, which is what a phone-shot feed looks like. */}
<video
src={SCREEN_VIDEO}
autoPlay
muted
loop
playsInline
preload="metadata"
aria-label="Autumn/winter lookbook film playing on the phone screen"
className="h-full w-full object-cover"
/>
</PhoneScrollHero>
);
}
































