Aspect Ratio
Constrain content to a fixed width-to-height ratio.
Import
tsx
import { AspectRatio } from "@cooud-ui/ui";
bash
npx cooud-ui add aspect-ratio
Examples
API Reference
Generated from the component's exported types.
AspectRatioProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
ratio | number | 16 / 9 | The desired width-to-height ratio, expressed as a number (e.g. `16 / 9`, `1`, `4 / 3`). Defaults to `16 / 9`. |