shadimage
exabase
uiaspect-ratiosource: ok · refreshed

Aspect Ratio

npx shadcn add "https://exawizards.com/exabase/design/registry/aspect-ratio.json"
free

No selection tags yet — empty means no evidence, not lack of support.

Files1 · source cached 10/7/2026, 4:09:43 AM

components/ui/aspect-ratio.tsx
import { cn } from "@/lib/utils"

function AspectRatio({
  ratio,
  className,
  ...props
}: React.ComponentProps<"div"> & { ratio: number }) {
  return (
    <div
      data-slot="aspect-ratio"
      style={
        {
          "--ratio": ratio,
        } as React.CSSProperties
      }
      className={cn("relative aspect-(--ratio)", className)}
      {...props}
    />
  )
}

export { AspectRatio }

More from exabase

Browse all components in this library →