Tulip Logo IconTulip
Components

Aspect Ratio

Displays content within a desired ratio.

Photo

Usage

import { AspectRatio } from "@tulip-systems/core/components/client";
<AspectRatio ratio={16 / 9}>
  <img src="..." alt="Image" className="rounded-md object-cover" />
</AspectRatio>

Examples

Square

A square aspect ratio component using the ratio={1 / 1} prop. This is useful for displaying images in a square format.

Photo

Portrait

A portrait aspect ratio component using the ratio={9 / 16} prop. This is useful for displaying images in a portrait format.

Photo

For more information, see the Radix UI documentation.

On this page