Open UI

Aspect Ratio

Imports

  • AspectRatio: The main component to display a list of accordion items.

Usage

Aspect Ratio
import * as React from 'react'
import { AspectRatio } from '@openlite/ui'
 
function App() {
  return (
    <AspectRatio ratio={16 / 9}>
      <img src="/example-gerzon.jpeg" alt="Aspect Ratio" className="h-full w-full rounded-md object-cover" />
    </AspectRatio>
  )
}

API

AspectRatio Props

PropsTypeDescription
ratiostring | number | AspectRatioObjectThe ratio of the aspect ratio.

On this page