{
  "$schema": "https://uipkge.dev/schema/registry-item.json",
  "name": "aspect-ratio",
  "title": "Aspect Ratio",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-svelte/components/aspect-ratio/AspectRatio.svelte",
      "content": "<script lang=\"ts\" module>\n  import type { HTMLAttributes } from 'svelte/elements'\n\n  export interface AspectRatioProps extends HTMLAttributes<HTMLDivElement> {\n    /** Width / height. `16 / 9` for video, `1` for squares, `4 / 3` for cards. */\n    ratio?: number\n    ref?: HTMLDivElement | null\n  }\n</script>\n\n<script lang=\"ts\">\n  import { cn } from '$lib/utils'\n\n  let { ratio = 1, class: className, children, ref = $bindable(null), ...restProps }: AspectRatioProps = $props()\n\n  const paddingBottom = $derived(`${100 / (ratio > 0 ? ratio : 1)}%`)\n</script>\n\n<div\n  bind:this={ref}\n  data-uipkge=\"\"\n  data-slot=\"aspect-ratio\"\n  style:position=\"relative\"\n  style:width=\"100%\"\n  style:padding-bottom={paddingBottom}\n  class={cn(className)}\n  {...restProps}\n>\n  <div style:position=\"absolute\" style:inset=\"0\">\n    {@render children?.()}\n  </div>\n</div>\n",
      "type": "registry:ui",
      "target": "~/src/lib/components/ui/aspect-ratio/AspectRatio.svelte"
    },
    {
      "path": "packages/registry-svelte/components/aspect-ratio/index.ts",
      "content": "export { default as AspectRatio, type AspectRatioProps } from './AspectRatio.svelte'\n",
      "type": "registry:ui",
      "target": "~/src/lib/components/ui/aspect-ratio/index.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [],
  "description": "Wraps content (typically images, video, or iframes) at a fixed width:height ratio so it never letterboxes or jumps as it loads. Common ratios: 16/9 for video, 1/1 for avatars, 4/3 for cards.",
  "categories": [
    "layout"
  ]
}