Widgets / ImagePreview

ImagePreview

A portable, captioned placeholder; overlay real pixels with Cmd.kittyImage.

ImagePreview┌────────────────────┐│││││🖼││logo.png││640×480│││└────────────────────┘

Signature

ImagePreview.render
    (width: int) (height: int)
    (borderStyle: Style) (captionStyle: Style)
    (caption: string) (pixelSize: (int * int) option)
    : LayoutNode<'msg>

Parameters

parameter type what it is
width / height int The placeholder box size, in cells.
caption string Shown under the icon (e.g. a filename).
pixelSize (int * int) option Optional WxH, shown as e.g. 640×480 when known.

Notes

This renders the portable placeholder that shows on every terminal. On Kitty/Ghostty, overlay the real pixels with Cmd.kittyImage positioned at the placeholder's coordinates — Mire never decodes images, so you supply encoded bytes.