evyos management
Gezinme

Iframe Demos

postMessage selection widgets

Overview

    Single Select

    NonFieldSingleIFrameInput

    Multi Select

    NonFieldMultiIFrameInput

postMessage
Zod-validated
Session-scoped

Iframe Selection Widgets

A cross-iframe selection pattern: the parent page opens a full-screen modal containing an iframe route. The user picks items, and the result is returned to the parent via window.postMessage. All payloads are validated with Zod and scoped by a per-session UUID.

Try Single SelectTry Multi Select
Single Select
NonFieldSingleIFrameInput

Pick exactly one entity from an iframe list. The iframe closes automatically after selection.

Hook: useSingleSelectIFrameOpen Demo
Multi Select
NonFieldMultiIFrameInput

Pick many entities with checkboxes. The iframe stays open until the user confirms, then sends the full selection back.

Hook: useMultiSelectIFrameOpen Demo
Message Protocol
1

Parent opens iframe with `?sessionId=<uuid>` appended to the URL.

2

Child attaches its `message` listener, then `useFrameChild` sends `{ kind: "I_AM_READY", sessionId }` to parent.

3

Parent optionally sends pre-selection payloads and always finishes hydration with `{ kind: "PARENT_SYNC_COMPLETE", sessionId, hasInitialData }`.

4

Child keeps a centered loading overlay on top of the iframe until parent sync is complete, even when the selection is empty.

5

User picks → child calls `sendBack({ uuid, data })` → parent receives validated payloads, then `CLOSE_MODAL`.