Aspect Ratio

Displays content within a desired ratio.

Features

    Accepts any custom ratio.

Installation

Install the component from your command line.

npm install @tealess/aspect-ratio

Anatomy

Import the component.

import * as AspectRatio from "@tealess/aspect-ratio";
export default () => <AspectRatio.Root />;

API Reference

Root

Contains the content you want to constrain to a given ratio.

PropTypeDefault
asChild
boolean
false
ratio
number
1
PreviousAlert Dialog
NextAvatar