Media
AspectRatio
A box that keeps its ratio as its width changes, with the content cropped to fill it.
WAI-ARIA tested
Import
main.ts
import { AspectRatio } from '@vitral/vue';Ratios
API
Read from packages/vue/src/components/AspectRatio/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| ratio | number | Width over height: `16 / 9`, `1`, `4 / 3`. Defaults to 1. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Slots
| Name | Slot props | Description |
|---|---|---|
| default | — | What fills the box: an image, a video, a map. |