interface

DeviceFrame

A phone or laptop bezel that wraps arbitrary content — children, an image src, or empty. A container component; scales-and-fades in on the house spring.

$ npx ondajs add device-frame

DeviceFrame

A phone or laptop bezel that wraps arbitrary content. Pass children (JSX), an image src, or neither. Like browser-frame, it's a container — the documented exception to the "self-contained" rule — and it scales-and-fades in on the house spring. Height is derived from the device aspect, so you only set width.

Props

PropTypeDefaultNotes
device'phone' | 'laptop''phone'Which bezel to draw.
srcstring?Image shown when no children.
childrenReactNode?Content to wrap (JSX only).
delaynumber0Frames before entrance.
animatebooleantrueScale-and-fade in.
widthnumber420Device width (height derived).
placementregion or {x,y,anchor}Canvas placement.

Usage

TSX
import { DeviceFrame } from './components/onda/device-frame/DeviceFrame';

export const ProductScene = () => (
  <DeviceFrame device="phone" src="/app-screenshot.png" placement="center" />
);