registry:component
Aspect Ratio
v1.0.0ga
Intrinsic ratio wrapper primitive for media and embeds.
Registry Endpoint
Open JSONnpx shadcn@latest add @aavya/ui-aspect-ratio
One-time setup — add the @aavya registry to your components.json so branded dependencies resolve to Aavya (not stock shadcn):
"registries": { "@aavya": "https://registry-dev.aavya.com/r/{name}.json" }Or install by full URL: npx shadcn@latest add https://registry-dev.aavya.com/r/ui-aspect-ratio.json
Live Preview
16:9 preview
Props
AspectRatio forwards remaining props to AspectRatioPrimitive.Root props.
Usage Snippet
import { AspectRatio } from '@/components/ui/aspect-ratio'
export default function Example() {
return (
<div className="p-6">
<AspectRatio />
</div>
)
}
Source Preview
'use client'
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio'
function AspectRatio({ ...props }: React.ComponentProps<typeof AspectRatioPrimitive.Root>) {
return <AspectRatioPrimitive.Root data-slot='aspect-ratio' {...props} />
}
export { AspectRatio }