modal
This component provides some modal dialog or messagebox. Basically it just offers a `div` that is rendered on a higher z-index than the rest of the application. It uses the reserved segments provided by the dev.fritz2.styling.theme.ZIndices.modal function that are initialized by dev.fritz2.styling.theme.Theme.zIndices. That way the top modal will always have the highest `z-index` and therefore be on top of the screen.
The content and structure within the modal are completely free to model.
As this factory function also returns a SimpleHandler<Unit>, it is easy to combine it directly with some other component that offers some sort of Flow, like a clickButton.
Basic usage
clickButton {
text("Open")
} handledBy modal {
content { // provide arbitrary content
p { +"Hello world from a modal!" }
}
}See also
Parameters
a lambda expression for declaring the styling as fritz2's styling DSL
optional CSS class that should be applied to the element
the ID of the element
the prefix for the generated CSS class resulting in the form `$prefix-$hash`
a lambda expression for setting up the component itself. Details in ModalComponent be aware that a SimpleHandler<Unit> is injected in order to apply it to some closing flow inside!