Aspect Ratio

Aspect ratio keeps content at a fixed width-to-height ratio so it scales correctly.

@radix-ui/react-aspect-ratio

Installation


1

Install the following dependencies:

npx shadcn@latest add https://sbthemes.com/r/aspect-ratio.json

Examples


Ratio (4/3)


API Reference

PropTypeDefault
widthnumber-