Skip to content

Aspect Ratio

An unstyled layout primitive, shared by the Mac and iPhone dialects, that keeps its content at a fixed width-to-height ratio for framing photos and video in seated wells.

Installation

Requires the theme. Register the @skeuomorph namespace and add @skeuomorph/skeuomorph first, as shown in the installation guide. The CLI also pulls it in as a dependency.

pnpm dlx shadcn@latest add @skeuomorph/aspect-ratio

Without the namespace, install straight from the URL:

pnpm dlx shadcn@latest add https://ui-skeuomorph.vercel.app/r/aspect-ratio.json

Usage

import { AspectRatio } from "@/components/ui/aspect-ratio"
<AspectRatio ratio={16 / 9}>
  <Image src="..." alt="Image" className="rounded-md object-cover" />
</AspectRatio>