bit Bheadless

Aspect Ratio

Displays content within a desired ratio, styled entirely with Tailwind utilities.

Implementation: CSS Tailwind

Basic (16 / 9)

Set Ratio to the desired width / height. Style the inner element with utilities โ€” they merge with the component's positioning styles.

Landscape photograph

Square (1 / 1)

The default ratio is 1 โ€” a perfect square. Great for avatars; the Ratio parameter is optional.

Portrait photograph

Portrait (3 / 4)

Ratios below 1 produce taller-than-wide boxes.

Portrait photograph

Non-image content

The inner element fills the reserved space, so flex centring works directly on the component.

2 : 1
An unhandled error has occurred. Reload ๐Ÿ—™