Aspect Ratio
Display content at a specific aspect ratio.
'use client'import { AspectRatio } from '@nerdfish/ui'import Image from 'next/image'export function AspectRatioExample() {return (<div className="w-[450px]"><AspectRatio ratio={16 / 9}><Imagesrc="https://images.unsplash.com/photo-1576075796033-848c2a5f3696?w=800&dpr=2&q=80"alt="Photo by Alvaro Pinot"fillclassName="rounded-container object-cover"/></AspectRatio></div>)}
Usage
import { AspectRatio } from '@nerdfish/ui'import Image from 'next/image'
<div className="w-[450px]"><AspectRatio ratio={16 / 9}><Imagesrc="https://images.unsplash.com/photo-1576075796033-848c2a5f3696?w=800&dpr=2&q=80"alt="Photo by Alvaro Pinot"fillclassName="rounded-container object-cover"/></AspectRatio></div>