Sean Hello

ReUI Aspect Ratio

Component

About

Responsive media containers in eight ReUI aspect ratios for widescreen, standard, square, ultrawide, portrait, photography, social media, and monitor layouts.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds ReUI Aspect Ratio to your project and fits it to your theme.

Code

How ReUI Aspect Ratio is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { AspectRatio } from "@/components/ui/reui-aspect-ratio"

export default function Pattern() {
  return (
    <div className="w-full max-w-xs">
      <AspectRatio
        ratio={4 / 5}
        className="bg-muted rounded-xl overflow-hidden border"
      >
        <img
          src="https://cdn.21st.dev/assets/mirror/e2/e278b22e41f12f18abe77ba7fe98b0a1eff379076574842945b5afb3c41186db.jpg"
          alt="4:5"
          width={1000}
          height={800}
          className="h-full w-full object-cover"
        />
      </AspectRatio>
    </div>
  )
}