# Aspect Ratio

> Constrains its content to a fixed width-to-height ratio.

_Updated: 2026-06-04_

Constrains its content to a fixed width-to-height ratio.

## Installation

```bash
railbase ui add aspect-ratio
```

## Usage

```tsx
import { AspectRatio } from "@/lib/ui/aspect-ratio";

<AspectRatio ratio={16 / 9}>
  <img src="/cover.jpg" alt="Cover" class="object-cover" />
</AspectRatio>
```
