Aspect Ratio is used to set the desired ratio.
import AspectRatio from "@radui/ui/AspectRatio"
const AspectRatioExample = () => (
<AspectRatio ratio='16/9'>
<img
style={{ width: '100%', height: '100%', objectFit: 'cover' }}
className="Image"
src="https://images.pexels.com/photos/346529/pexels-photo-346529.jpeg?cs=srgb&dl=pexels-bri-schneiter-28802-346529.jpg&fm=jpg"
alt="Landscape photograph"
/>
</AspectRatio>
)
Prop | Type | Default | Description |
---|---|---|---|
ratio | string | 1 | Used to set desired ratio |