Skip to content

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>