Aspect Ratio
Live preview from the library's source
Install
From shadcn/ui
npx shadcn@latest add https://ui.shadcn.com/r/styles/new-york-v4/aspect-ratio.jsonFrom this collection
npx shadcn@latest add https://allcomps.vercel.app/r/ui-shadcn--aspect-ratio.jsonCode
"use client"
import { AspectRatio as AspectRatioPrimitive } from "radix-ui"
function AspectRatio({
...props
}: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
return <AspectRatioPrimitive.Root data-slot="aspect-ratio" {...props} />
}
export { AspectRatio }
Other layout & grids
The same kind of component from the other libraries in the collection.