Docs
Aspect Ratio

Aspect Ratio

Displays content within a desired ratio.

Loading...

Installation

Install the following dependencies:

npm install @radix-ui/react-aspect-ratio

Copy and paste the following code into your project.

"use client"
 
import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio"
 
const AspectRatio = AspectRatioPrimitive.Root
 
export { AspectRatio }

Copy and paste the aspect-ratio code into your project.