{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "display",
  "status": "alpha",
  "import": "@senvenli/react/display",
  "name": "image-viewer",
  "title": "Image viewer",
  "exports": [
    "ImageViewer"
  ],
  "description": "A full-screen dark lightbox with previous/next that cycle, arrow keys, a position caption and a filmstrip.",
  "keywords": [
    "lightbox",
    "photos",
    "gallery",
    "fullscreen"
  ],
  "usage": {
    "when": [
      "Looking at photos full size."
    ],
    "instead": [
      {
        "use": "carousel",
        "when": "Pictures page in place, inside the layout."
      },
      {
        "use": "image",
        "when": "One picture is shown at its place in the page."
      }
    ]
  },
  "a11y": {
    "keyboard": [
      {
        "keys": "Arrow left / right",
        "does": "Previous or next photo, following the reading direction."
      },
      {
        "keys": "Esc",
        "does": "Closes the viewer."
      }
    ],
    "builtIn": [
      "Focus stays inside while open and returns to what opened it."
    ],
    "youProvide": [
      "A title and alt text."
    ]
  },
  "related": [
    "carousel"
  ],
  "genui": {
    "expose": false
  },
  "source": [
    "src/display/image-viewer.tsx"
  ],
  "props": {
    "ImageViewer": [
      {
        "name": "image",
        "type": "ImageViewerImage",
        "required": false,
        "origin": "own",
        "default": "PlainImage",
        "description": "The image renderer (e.g. next/image); a plain `<img>` by default."
      },
      {
        "name": "items",
        "type": "CarouselItem[]",
        "required": true,
        "origin": "own",
        "description": "The photos in display order, each with its own alt text: the same shape as Carousel's `items`.",
        "schema": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "src": {
                "type": "string"
              },
              "alt": {
                "type": "string"
              }
            },
            "required": [
              "src",
              "alt"
            ]
          }
        }
      },
      {
        "name": "defaultIndex",
        "type": "number",
        "required": false,
        "origin": "own",
        "default": "0",
        "description": "The photo to open on; wrapped into range.",
        "schema": {
          "type": "number"
        }
      },
      {
        "name": "isOpen",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "default": "true",
        "description": "Open by default, so rendering it opens it; or control it with `onOpenChange`.",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "onOpenChange",
        "type": "(isOpen: boolean) => void",
        "required": false,
        "origin": "own",
        "description": "Called with `false` on Esc, the close button or a press on the scrim."
      },
      {
        "name": "title",
        "type": "string",
        "required": true,
        "origin": "own",
        "description": "Caption shown at the bottom and used as the accessible dialog title.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "labels",
        "type": "{ close?: string; previous?: string; next?: string; position?: (index: number, total: number) => string; }",
        "required": false,
        "origin": "own",
        "description": "The viewer's words; the DS strings by default (\"Close\", \"Previous image\", \"Next image\", \"Image 2 of 5\")."
      }
    ]
  },
  "tokens": [
    "ds-background-neutral-bold",
    "ds-blanket",
    "ds-border-focused",
    "ds-border-selected",
    "ds-icon",
    "ds-icon-brand",
    "ds-icon-danger",
    "ds-icon-information",
    "ds-icon-subtle",
    "ds-icon-success",
    "ds-icon-warning",
    "ds-radius-full",
    "ds-radius-medium",
    "ds-radius-xlarge",
    "ds-shadow-overlay",
    "ds-size-icon",
    "ds-size-icon-large",
    "ds-size-icon-small",
    "ds-space-025",
    "ds-space-100",
    "ds-space-150",
    "ds-space-200",
    "ds-space-250",
    "ds-space-800",
    "ds-surface",
    "ds-surface-hovered",
    "ds-surface-overlay",
    "ds-surface-sunken",
    "ds-text",
    "ds-text-inverse",
    "ds-text-subtle"
  ],
  "strings": [
    "close",
    "goToImage",
    "imagePosition",
    "nextImage",
    "previousImage"
  ],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
