{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "aspect-ratio",
  "title": "Aspect Ratio",
  "description": "Astro containers that keep media and embeds at a chosen width-to-height ratio.",
  "dependencies": [
    "cn"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "packages/ui/src/components/ui/aspect-ratio/aspect-ratio.astro",
      "content": "---\nimport type { HTMLAttributes } from \"astro/types\"\n\nimport { cn } from \"cn\"\nimport type { AspectRatioProps } from \"./types.ts\"\n\n/** Div attributes pass through. */\ntype Props = HTMLAttributes<\"div\"> & AspectRatioProps\n\nconst { class: className, ratio, style: styleProp, ...props } = Astro.props\n\nif (!Number.isFinite(ratio) || ratio <= 0) {\n  throw new RangeError(\"AspectRatio needs a finite ratio greater than zero.\")\n}\n\nconst style =\n  typeof styleProp === \"string\"\n    ? `--ratio: ${ratio}; ${styleProp}`\n    : {\n        \"--ratio\": ratio,\n        ...(styleProp ? styleProp : {}),\n      }\n---\n\n<div\n  data-slot=\"aspect-ratio\"\n  style={style}\n  class={cn(\"relative aspect-(--ratio)\", className)}\n  {...props}\n>\n  <slot />\n</div>\n",
      "type": "registry:file",
      "target": "~/src/components/ui/aspect-ratio/aspect-ratio.astro"
    },
    {
      "path": "packages/ui/src/components/ui/aspect-ratio/index.ts",
      "content": "export { default as AspectRatio } from './aspect-ratio.astro'\n\nexport type { AspectRatioProps } from './types.ts'\n",
      "type": "registry:file",
      "target": "~/src/components/ui/aspect-ratio/index.ts"
    },
    {
      "path": "packages/ui/src/components/ui/aspect-ratio/types.ts",
      "content": "/**\n * Props for a box that keeps a fixed width-to-height ratio.\n * Div attributes such as `class` and `id` pass through on the component.\n */\nexport interface AspectRatioProps {\n    /**\n     * Width divided by height.\n     *\n     * Common values include `16 / 9`, `4 / 3`, `1`, `9 / 16`, and `21 / 9`.\n     */\n    ratio: number\n}\n",
      "type": "registry:file",
      "target": "~/src/components/ui/aspect-ratio/types.ts"
    }
  ],
  "meta": {
    "framework": "astro",
    "source": "@gnostic/ui",
    "testedDependencies": {
      "cn": "0.5.2"
    }
  },
  "docs": "https://ui.gnosticai.com/components/aspect-ratio",
  "categories": [
    "ui"
  ],
  "type": "registry:ui"
}
