MockupsNew
Glass Phone Duo
A WebGL2 folding phone mockup with your screenshots on both displays.
Requires WebGL2 and screenshots from your origin or served with CORS.
Preview
ClosedOpen
Demos ready. Update 0.
Installation
For React 19+ apps with Tailwind CSS 4.
npx shadcn@4.14.1 add @glassyui/glass-phone-duoAdds 3 files to components/glassyui and installs clsx.
Usage
Usage
import { GlassPhoneDuo } from "@/components/glassyui/glass-phone-duo";
export function Showcase() {
return (
<GlassPhoneDuo
className="w-full max-w-2xl"
screenSrc="/app-landscape.png"
screenAlt="The app on the unfolded display"
coverSrc="/app-portrait.png"
coverAlt="The app on the cover display"
/>
);
}Examples
Open and close
const [open, setOpen] = useState(true);
return (
<>
<GlassPhoneDuo
open={open}
finish="star-white"
screenSrc="/app-landscape.png"
coverSrc="/app-portrait.png"
/>
<button type="button" onClick={() => setOpen(!open)}>
{open ? 'Close phone' : 'Open phone'}
</button>
</>
);Pose the hinge
<GlassPhoneDuo
angle={120}
view="back"
finish="night-sky"
screenSrc="/app-landscape.png"
coverSrc="/app-portrait.png"
/>Stand poses
<GlassPhoneDuo
pose="laptop"
angle={90}
finish="star-white"
screenSrc="/app-landscape.png"
coverSrc="/app-portrait.png"
/>
<GlassPhoneDuo
pose="tent"
angle={60}
screenSrc="/app-landscape.png"
coverSrc="/app-portrait.png"
/>API reference
GlassPhoneDuo
A figure with role img that draws the phone on a canvas.
| Prop | Type | Default | Description |
|---|---|---|---|
screenSrcRequired | string | None | Landscape screenshot for the inner display, at a 2670:1878 ratio. Same origin or served with CORS. |
coverSrcRequired | string | None | Portrait screenshot for the outer display, at a 1398:2034 ratio. Same origin or served with CORS. |
screenAlt | string | 'App on the unfolded phone display' | Accessible label while the front of the open phone shows. |
coverAlt | string | 'App on the outer phone display' | Accessible label while the closed phone shows, or the back of the open phone. |
open | boolean | true | Opens or closes the hinge. Ignored when angle is set. |
angle | number | None | Hinge angle from 0 (closed) to 180 (flat), clamped. Overrides open; while it is set, view and pose changes apply at once. |
finish | 'night-sky' | 'star-white' | 'night-sky' | Frame colour. |
view | 'front' | 'back' | 'front' | Which side faces you. back shows the rear cameras. |
pose | 'upright' | 'book' | 'tent' | 'laptop' | 'side' | 'upright' | Device orientation; angle still sets the hinge. tent and laptop show screenSrc on the outer display and coverSrc across the inner one. |
glare | boolean | true | A faint reflection across the displays. |
Also accepts HTML figure attributes (no children).
- Types
GlassPhoneDuoPropsGlassPhoneDuoFinishGlassPhoneDuoPose

