Skip to content
Data Display

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>

PropTypeDefaultDescription
ratio
number16 / 9The desired width-to-height ratio, expressed as a number (e.g. `16 / 9`, `1`, `4 / 3`). Defaults to `16 / 9`.