Vinyl UI

Aspect Ratio

Keeps content at a fixed ratio.

Vinyl styling: Unstyled; pair it with Test Pattern for 4:3 CRT frames.

Installation

npx shadcn@latest add @vinyl/aspect-ratio

The @vinyl registry URL in components.json decides whether you get the web or the native version (see installation for web / native).

Usage

<AspectRatio ratio={4 / 3}>
  <TestPattern className="size-full" />
</AspectRatio>

API

Same API as shadcn/ui's Aspect Ratio on the web, and React Native Reusables' Aspect Ratio on native. Vinyl only changes styling and motion.

On this page