BrowseLaptop

Mockups

Glass Laptop

A 3D laptop built in CSS that opens to show your screenshot or live content.

Preview

Installation

Install the package once, then import the parts you use into a standalone component.

Install

npm install ngx-vitreo @angular/cdk @floating-ui/dom
Import

import { GlassLaptop } from 'ngx-vitreo';

@Component({
  imports: [GlassLaptop],
  // ...
})

Usage

Usage

<figure glassLaptop aria-label="The app on a laptop" finish="silver" [open]="open()">
  <img alt="" src="/app.png" style="width: 100%; height: 100%; object-fit: cover" />
</figure>

API reference

GlassLaptop

figure[glassLaptop]

InputTypeDefaultDescription
contentprojected contentNoneScreen content, laid out at resolution CSS pixels wide and scaled to fit. It is attached only while the lid is open and still.
openbooleantrueWhether the lid is up. Changing it opens or closes the lid.
finish'black' | 'silver''black'Case colour.
resolutionnumber1728Width in CSS pixels the content is laid out at before it is scaled to the screen.
glarebooleantrueA faint reflection across the screen. Turn it off for flat screenshots.