Skip to content

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.

PropTypeDescription
ratio*number

Styling hooks: [data-slot="aspect-ratio"].

Search documentation

Search pages, components and blocks.