GitHub

Aspect Ratio

Displays content within a desired ratio.

Photo by Drew Beamer

Installation

npx solidui-cli@latest add aspect-ratio

Usage

import { AspectRatio } from "~/components/ui/aspect-ratio"
<AspectRatio ratio={16 / 9}>
  <img src="..." alt="..." class="size-full rounded-md object-cover" />
</AspectRatio>