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/domImport
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]
| Input | Type | Default | Description |
|---|---|---|---|
content | projected content | None | Screen content, laid out at resolution CSS pixels wide and scaled to fit. It is attached only while the lid is open and still. |
open | boolean | true | Whether the lid is up. Changing it opens or closes the lid. |
finish | 'black' | 'silver' | 'black' | Case colour. |
resolution | number | 1728 | Width in CSS pixels the content is laid out at before it is scaled to the screen. |
glare | boolean | true | A faint reflection across the screen. Turn it off for flat screenshots. |