Layout · ui · 1K

Aspect ratio

Radix AspectRatio with shadcn/ui's API: keeps content at a fixed width-to-height ratio. It draws nothing itself; frame it with s7-frame and fill it with a checker or a dithered image.

Install

pnpm dlx shadcn@latest add @s7ui/aspect-ratio

Example

This example also uses @s7ui/icons.

16 : 9
4 : 3
1 : 1

Info

Files:
components/ui/aspect-ratio.tsx
Uses:
@s7ui/theme
Packages:
radix-ui