uipack

Aspect Ratio

Aspect ratio allows usage of specified dimensions without a fixed height. The aspect ratio syntax is HorizontalRatio:VerticalRatio. For example, YouTube videos are in a 16:9 aspect ratio regardless of what the precise width may be.

Usage

import AspectRatio from '@ui-pack/react/aspect-ratio'
Landscape - Youtube
Portrait

Notes

Props

as

oneOfType: string, function

Default: div

ratio

stringrequired

Default: 1:1