Overview
Aspect Ratio displays content within a desired aspect ratio by automatically computing height based on the provided ratio and width.Features
- Ensures content maintains a specific aspect ratio
- Accepts any custom ratio
Installation
Anatomy
API Reference
Root
Contains the content constrained to the given ratio.number
default:"1"
The desired ratio. For example,
16/9 for a 16:9 aspect ratio.Examples
Image with 16:9 Ratio
Square Ratio
Video with 4:3 Ratio
Use Cases
- Maintaining consistent image ratios in responsive layouts
- Embedding videos that maintain their aspect ratio
- Creating placeholder containers with specific ratios
- Building image galleries with consistent dimensions