Shoji API Reference
    Preparing search index...

    Interface GalleryItem

    See DESIGN.md §2.1 — the full item model grows plugin-by-plugin (editor, ...).

    interface GalleryItem {
        id?: string;
        src: string;
        srcset?: string;
        sizes?: string;
        sources?: MediaSource[];
        thumb?: string;
        poster?: string;
        video?: VideoDescriptor;
        width?: number;
        height?: number;
        thumbnailWidth?: number;
        thumbnailHeight?: number;
        alt?: string;
        caption?: string | HTMLElement | DangerousHtmlCaption;
        download?: string | false;
        data?: Record<string, unknown>;
    }
    Index
    id?: string
    src: string
    srcset?: string
    sizes?: string
    sources?: MediaSource[]
    thumb?: string
    poster?: string
    width?: number
    height?: number
    thumbnailWidth?: number

    The thumbnail's own true pixel size — never the real photo's, which width/height above already cover. Only meaningful when a thumbnail's rendered shape can genuinely differ from the photo it represents (e.g. a host's own fixed-shape thumbnail grid next to a variable-aspect-ratio photo). Takes priority over width/height wherever the thumbnail's own shape is what matters, when both are given: Layout's own tile-shape sizing (src/plugins/layout) — a tile represents the thumbnail, not the photo — and the zoom-transition's open-placeholder sizing (zoomTransition.ts, via Gallery.ts's resolveAspectRatio/resolveNaturalSize), which really does show the thumbnail image itself and grows it to a real, correctly-scaled size rather than the real photo's (possibly very different) shape. Falls back to width/height wherever this is unset — no behavior change for an item that never declares it.

    thumbnailHeight?: number
    alt?: string
    caption?: string | HTMLElement | DangerousHtmlCaption
    download?: string | false
    data?: Record<string, unknown>

    Free-form payload, untouched by core beyond one thing: in selector mode, scan.ts populates this from any data-shoji-* attribute that isn't already one of the named fields above (e.g. data-shoji-metadata-id="123" → data.{'metadata-id': '123'}) — dynamic-mode items only ever get whatever the host puts here directly.