Module

Halogen.Widgets.Modal

Package
purescript-halogen-widgets
Repository
afcondon/purescript-halogen-widgets

A modal dialog — the chrome-function tier (see CONTRACT.md rule 5). Because a modal wraps caller-owned interactive content (forms, buttons), it cannot be a leaf component: it is a render function, polymorphic in the caller's action i, so the caller's body and the supplied onClose action thread straight through untouched.

The backdrop and panel are siblings (not nested), so a click inside the panel never reaches the backdrop's onClose — no stopPropagation needed.

#ModalConfig Source

type ModalConfig i = { onClose :: i, open :: Boolean, title :: String }

#modal Source

modal :: forall w i. ModalConfig i -> Array (HTML w i) -> HTML w i

modal config body — renders nothing when closed; otherwise a centred panel over a dimming backdrop, with body as its content.