Aspect Ratio
Container that holds its content to a fixed width to height ratio.
Installation
bun add @xerobi/ui
import { AspectRatio } from "@xerobi/ui/aspect-ratio"This component is client-side. In Astro, hydrate it with a client directive.
API reference
AspectRatio
Also accepts every prop of <div> element.
| Prop | Type | Description |
|---|---|---|
| ratio* | number |
Styling hooks: [data-slot="aspect-ratio"].