Optionaloptions: ModalLayerOptionsThe floating modal lifecycle from a component effect:
useEffect(() => {
openModalLayer('confirm-dialog', 100);
applyElementToModalLayer('confirm-dialog', {
elementId: 'confirm-dialog-element',
element: ConfirmDialog,
props: { onCancel: () => closeModalLayer('confirm-dialog') },
});
return () => closeModalLayer('confirm-dialog');
}, []);
Open a new modal layer with a unique ID and z-index.
The keyboard difference from a regular layer: a modal layer takes over the keyboard. While it is open, key events are routed to it first and blocked from reaching layers and screens below unless a binding calls
allowModalto release specific keys through the barrier (the engine treats the active modal as the highest-priority pipeline stage). Modal and regular layers share the layer-ID namespace, so an ID cannot be reused across the two.