- Components
- Layout
- Aspect Ratio
Aspect Ratio
Displays content within a desired ratio.
default.tsx
Installation
CLI
Manual
npm
pnpm
yarn
bun
Usage
Use the AspectRatio
component to display content within a desired ratio.
Options
AsChild
Use the asChild
prop to change the default rendered element for the one passed as a child, merging their props and behavior.
as-child.tsx
API Reference
Prop | Type | Default | Description |
---|---|---|---|
asChild | boolean | false | Change the default rendered element for the one passed as a child, merging their props and behavior. |
ratio | number | 1 | The desired ratio |
Last updated on 10/11/2024