{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "picture-figure",
  "title": "Picture Figure",
  "description": "A picture at its proportions, its height set by the page, with a caption hanging under it that takes no room. No dependencies.",
  "files": [
    {
      "path": "registry/mewo/ui/picture-figure.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface PictureFigureProps extends Omit<React.ComponentProps<\"figure\">, \"children\"> {\n  src?: string\n  /** Width ÷ height of the frame. Its height comes from className. */\n  ratio?: number\n  alt?: string\n  /** Hangs under the picture, centred and at least 32rem wide (e.g. a credit). */\n  caption?: React.ReactNode\n}\n\nexport const DEFAULT_SRC = \"https://cataas.com/cat/1si02A2ZNdeNH3yo\"\n\n/** A picture at its proportions, its height set by className, with a caption hanging under it that takes no room. */\nexport function PictureFigure({\n  src = DEFAULT_SRC,\n  ratio = 4 / 5,\n  alt = \"\",\n  caption,\n  className,\n  ...props\n}: PictureFigureProps) {\n  return (\n    <figure data-slot=\"picture-figure\" className={cn(\"[--story-u:min(2.6667cqw,12px)] min-[901px]:[--story-u:0.625cqw] min-[901px]:@max-[900px]:[--story-u:min(2.6667cqw,12px)] text-[length:var(--story-u)] [--spacing:calc(var(--story-u)*0.25)]\", \"relative m-0\", className)} {...props}>\n      <div className=\"relative h-full overflow-hidden\" style={{ aspectRatio: String(ratio) }}>\n        {/* eslint-disable-next-line @next/next/no-img-element -- items cannot use next/image */}\n        <img src={src} alt={alt} className=\"absolute inset-0 size-full object-cover\" />\n      </div>\n      {caption && <figcaption className=\"absolute top-full left-1/2 w-[max(100%,calc(var(--story-u)*32))] -translate-x-1/2 pt-[calc(var(--story-u)*1.8)]\">{caption}</figcaption>}\n    </figure>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "meta": {
    "added": "2026-10-27",
    "unlisted": true
  },
  "categories": [
    "card"
  ],
  "type": "registry:ui"
}