# AspectRatio

Reserved media proportions that respond to their containing width.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, AspectRatio, Image } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <AspectRatio ratio={16 / 9}><Image src="/flood-mark.png" alt="Flood logo" fit="contain" /></AspectRatio>
    </FloodRoot>
  );
}
```

## Design notes

- ratio must be finite and positive. The root reserves media geometry before image loading.
- Direct img/video/iframe children fill the reserved box. Content can overflow; the component does not clip focus, menus or arbitrarily tall text.
- Host media owns alt, captions, controls and loading. Native props/ref target the outer div.
- Available in 0.2.4; use matching installed declarations.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `ratio` | `number` | `16 / 9` |
| `Native HTML props` | `HTMLAttributes<HTMLDivElement>` | `Forwarded` |
