Dev Design Library

Aspect Ratio

Maintains a consistent width-to-height ratio for images, videos, and embeds, preventing layout shifts when pages load or resize.

Aspect Ratio preview
Library
SpaceUI
Framework
React
Type
component
License
MIT
Files
  • src/registry/primitives/aspect-ratio/index.tsx
  • src/registry/lib/utils/index.ts
Source
https://github.com/usespaceui/ui

Categories

More from SpaceUI