Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/live-preview/hooks/usePreviewMeasure

Cockpit client (features), next. Source: ui/client/features/live-preview/hooks/usePreviewMeasure.tsx.

Functions#

usePreviewMeasure()#

usePreviewMeasure(): object

Defined in: ui/client/features/live-preview/hooks/usePreviewMeasure.tsx:9

Measures the box the preview iframe fills, live. A callback ref, because the box is mounted and unmounted as the preview connects, disconnects and goes full screen — each time we re-observe whatever is now there. This is what makes the size readout honest: "1280" in a 900px stage reads 900.

Returns#

object

boxRef

boxRef: (node) => void

Parameters
node

HTMLDivElement | null

Returns

void

measured

measured: { height: number; width: number; } | null