Zephora UI

Layout

AspectRatio

Constrains its child to a fixed width/height ratio; the child fills the box. Useful for media, maps and embeds.

Import

import { AspectRatio } from "@zephora/react";

Examples

16:9

The default ratio suits video embeds and hero media.

16 : 9

Other ratios

Any number works — 1 for squares, 4/3 for classic photos.

1 : 1
4 : 3

API

AspectRatio props

PropTypeDefaultDescription
rationumber16 / 9Width / height ratio (e.g. 16/9, 1, 4/3).
unstyledbooleanfalseHeadless mode — skips Zephora styling.