EnterUI
DocsComponentsThemesExamplesDonation
Get Started
      • ScrollArea
      • AspectRatio
      • ImageViewer
      • Media
      • VirtualList

Default usage

  1. EnterUI
  2. /Docs
  3. /Layout and Utilities
  4. /Layout Primitives
  5. /Media and Scroll
  6. /AspectRatio
Updated 3 October 2026

AspectRatio

A stable ratio box for images, previews, embeds, and media shells.

AspectRatio defines how EnterUI handles a stable ratio box for images, previews, embeds, and media shells, including default structure, accessible states, and token-driven styling.

#Default usage

Aspect ratio

Children fill the ratio box without causing layout shift.

EnterUI mark
Code
<AspectRatio ratio={16 / 9}>
  <img src="/enterui-logo-square.png" alt="EnterUI mark" />
</AspectRatio>

#Import

Code
import { AspectRatio } from "@froggdesign/enter-ui-react";

#Accessibility

AspectRatio does not add media semantics. Keep meaningful alt text on images and titles on embeds.

#API

  • ratio defaults to 16 / 9.
  • Accepts native div props, style, and className.

#Styling

Uses CSS aspect-ratio and .eui-aspect-ratio.

PreviousScrollArea
NextImageViewer
On this page
  • Default usage
  • Import
  • Accessibility
  • API
  • Styling