Aspect Ratio
Displays content within a desired ratio. Essential for maintaining consistent image shapes across responsive layouts.
$cookest-ui add aspect-ratio
16:9 Video
Standard widescreen ratio for recipe video thumbnails.
๐Pasta Carbonara โ Recipe Video16:9 ยท 8:24
1:1 Square
Square ratio for recipe card thumbnails and profile images.
๐Margherita
๐Ramen
๐ฅSalad
4:3 Classic
Traditional photo ratio โ great for printed recipe cards.
๐ฅฉBeef Bourguignon4:3 aspect ratio
| Prop | Type | Default | Description |
|---|---|---|---|
ratio | number | 1 | The desired aspect ratio. e.g. 16/9, 4/3, 1 (square), 9/16 (portrait). |
className | string | โ | Custom classes applied to the outer container. |
children | ReactNode | โ | Content to display within the ratio container. |