Skip to content
aq-ui
Back to ComponentsComponent

Aspect Ratio

Open-code aq-ui accessible component family for Aspect Ratio.

Preview

This is a live example. Interact with the available controls and use the keyboard to inspect the component's states and behavior.

16 / 9Build for every screen

Installation

pnpm dlx aq-ui@alpha add aspect-ratio

API reference

SSR-safe

Import the parts you need, then jump to an export for its contract.

View full source

Quick start

import { AspectRatio } from "@/components/ui/aspect-ratio"

<AspectRatio />

AspectRatio

constSource L4

Open-code aq-ui accessible component family for Aspect Ratio.

const AspectRatio = React.forwardRef<React.ComponentRef<"div">, React.ComponentProps<"div"> & { ratio: number }>(…)
Props type
React.ComponentProps<"div"> & { ratio: number }

Props

NameType
rationumber
<AspectRatio />

Registry dependencies

utils

Files

  • components/ui/aspect-ratio.tsx

Source