Skip to Content

Frame

Constrains media to a chosen aspect ratio. Overflow is cropped so images and videos fit cleanly within the frame.

Usage

<div data-unitone-layout="frame"> <img src="..." alt="" style="width: 100%" /> </div>

Props

HTML --unitone--ratio / JSX ratio={value}

Aspect ratio.

<div data-unitone-layout="frame" style="--unitone--ratio: 4/3"> <img src="..." alt="" style="width: 100%" /> </div>

HTML -switch / JSX switchRatio

Switch aspect ratio when portrait and mobile width.

<div data-unitone-layout="frame -switch"> <img src="..." alt="" style="width: 100%" /> </div>
Last updated on