Aspect Ratio
Displays content within a desired ratio.
Features
- Accepts any custom ratio.
Installation
Install the component from your command line.
sh
$ npm add reka-uiAnatomy
Import the component.
vue
<script setup>
import { AspectRatio } from 'reka-ui'
</script>
<template>
<AspectRatio />
</template>API Reference
Root
Contains the content you want to constrain to a given ratio.
| Prop | Default | Type |
|---|---|---|
as | 'div' | AsTag | ComponentThe element or component this component should render as. Can be overwrite by |
asChild | booleanChange the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. | |
ratio | 1 | numberThe desired ratio. Eg: 16/9 |
| Slots (default) | Payload |
|---|---|
aspect | numberCurrent aspect ratio (in %) |
