Aspect Ratio
Aspect maintains a fixed aspect ratio for its content, useful for images, videos, and embeds.
Basic Usage
16:9
import { Aspect } from "@paramanu/primitives-react"
export default function App() {return ( <div style={{ width: 400 }}> <Aspect ratio="16/9"> <div>16:9</div> </Aspect> </div>)}<div style="width: 400px;"><div class="pm-aspect pm-aspect--16-9"> <div style="background: #e2e8f0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;">16:9</div></div></div>React Props
| Prop | Type | Default | Description |
|---|---|---|---|
ratio | "1/1" | "2/3" | "3/2" | "4/3" | "3/4" | "16/9" | "9/16" | "21/9" | "16/9" | Aspect ratio |
CSS Classes
| Class | Purpose |
|---|---|
pm-aspect | Base |
pm-aspect--{ratio} | Ratio (e.g., --16-9) |