reflex-dom-contrib-0.3: A playground for experimenting with infrastructure and common code for reflex applications

Safe HaskellNone
LanguageHaskell2010

Reflex.Dom.Contrib.Widgets.Modal

Synopsis

Documentation

data HidingStrategy Source

When the hiding strategy is RemoveFromDOM, the widget adds and removes the modal markup from the DOM when the modal is opened and closed. For DisplayNone and VisibilityInvisible the modal markup is always kept in the DOM and visibility is controlled by setting the style to display:none or visibility:invisible respectively. DisplayNone causes the elements to be completely taken out of the document flow. This means that widgets in the modal will only be able to get things like height when the modal is visible. Using VisibilityInvisible gets around this limitation.

data ModalConfig Source

Constructors

ModalConfig 

Fields

modalHidingStrategy :: HidingStrategy
 
modalAttributes :: Map String String

Attributes to put on the modal's outermost div

modal Source

Arguments

:: MonadWidget t m 
=> ModalConfig 
-> Event t Bool

Event to open and/or close the model

-> m (Event t a, Event t ())

Widget rendering the body of the modal. Returns an event with a success value and an event triggering the close of the modal.

-> m (Event t a) 

mkModalBody Source

Arguments

:: MonadWidget t m 
=> m (Event t ())

A header widget returning an event that closes the modal.

-> (Dynamic t (Either e a) -> m (Event t (), Event t ()))

Footer widget that takes the current state of the body and returns a pair of a cancel event and an ok event.

-> m (Dynamic t (Either e a)) 
-> m (Event t (Either e a), Event t ()) 

Template for a modal with a header, body, and footer where the header has a close icon and the footer has a cancel and save button.