AspectRatio
Unstyled layout utility for displaying images, videos, or cards at a fixed aspect ratio using native CSS aspect-ratio.
Fully compatible with the standard shadcn/ui JSX API. AspectRatio is a pure layout utility powered by native CSS aspect-ratio, carrying no surface material or border radius so it nests seamlessly inside glass Cards, Carousels, and other containers. Add Apple-style corner radii directly via className, such as rounded-[18px] on mobile ↔ md:rounded-[12px] on desktop.
Installation (Shadcn Registry)
npx shadcn@latest add @apple-liquid/aspect-ratioUsage
import { AspectRatio } from '@/components/ui/aspect-ratio';
export function Example() {
return (
<AspectRatio ratio={16 / 9} className="overflow-hidden rounded-[18px] md:rounded-[12px]">
<img src="/cover.jpg" alt="Cover" className="size-full object-cover" />
</AspectRatio>
);
}Props API
| Prop | Type | Default | Description |
|---|---|---|---|
ratio | number | — | Desired width-to-height ratio, e.g. 16 / 9 or 1 (required) |
AlertDialog
Responsive Apple Liquid Glass alert dialog reproducing macOS 27's compact 26px-radius alert with pill buttons on desktop, and automatically adapting to iOS 27's 34px-radius centered Liquid Glass alert with 48px capsule buttons on mobile.
Attachment
File and image attachment cards with Liquid Glass by default, supporting uploading, processing, error, and idle states, and automatically switching to Over-Glass inside message composers.