Skip to Content
Skip to content

Aspect Ratio

Aspect ratio on the Radix primitive. Pure logic with a data-slot attribute.

Installation

bunx --bun shadcn@latest add https://neu.beyondtheinnovation.com/r/neu-aspect-ratio.json

Usage

import { AspectRatio } from "@/components/ui/neu/aspect-ratio"
<AspectRatio ratio={16 / 9}>
  <img src="/photo.jpg" alt="Photo" className="size-full object-cover" />
</AspectRatio>

On this page