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'
Notes
- See browser support for CSS
aspect-ratio
- Read Una Kravets describing the
aspect-ratio
in CSS
Props
as
oneOfType: string, function
Default: div
ratio
stringrequired
Default: 1:1