16 / 9
1 / 1
Installation
$ pnpm dlx shadcn@latest add @synccn/aspect-ratioFirst time in this project? Connect synccn with one command.
Usage
import { AspectRatio } from "@/components/ui/collapsible";<AspectRatio ratio={16 / 9}>…</AspectRatio>API reference
Generated from the component's TypeScript types, so it always matches the code.
AspectRatio
Keeps media at a fixed ratio, e.g. 16/9.
PropTypeDescription
- ratio
numberDefault
16 / 9Width divided by height, e.g. 16 / 9.
- className
stringExtra classes for the root element.
- children
React.ReactNodeContent to render.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
npm packages
- clsx for cn()
- tailwind-merge for cn()
- lucide-react for ChevronsUpDown
Accessibility
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-controls, aria-expanded
More display
CardSurface with header, content and footer slots.BadgeSmall status label with an optional dot.AvatarImage with initials fallback, presence dot and stacked groups.KbdKeyboard key for shortcuts and hints.SeparatorHorizontal, vertical or labelled divider.AccordionExpanding sections with smooth height animation.