mica

Example

16:9 (default)

square

4:3

--ratio: 21/9

Basic usage

<m-frame ratio="square">
  <img src="photo.jpg" alt="…">
</m-frame>

API

Attributes

NameType/ValuesDefaultDescription
ratiosquare · 16:9 · 4:3 · 3:2 · 2:1 · 9:1616:9Sets the frame's aspect ratio.

Content/markup contract

NameType/ValuesDefaultDescription
Direct mediaimg · videoFills the frame and crops with object-fit: cover.
Picture mediapicture > imgThe image fills the frame and crops with object-fit: cover.
Other contentany elementCenters in the frame.

Styling

NameType/ValuesDefaultDescription
--ratioCSS ratio16 / 9Accepts any fraction, for example style="--ratio: 21 / 9".
← reelcover →