gribouille / elm-bulma / Modal

Modal component.

Types


type alias Button msg =
{ title : String
, trigger : msg
, enable : Basics.Bool 
}

Modal button.


type alias Config msg =
{ title : String
, size : Size
, content : Html msg
, close : Button msg
, save : Maybe (Button msg) 
}

Modal configuration. If save is nothing, the save button is hidden.

Example

{ title = "My Modal title"
, size = Medium
, content = div [] [...]
, close = Button "Close" OnClose True
, save = Just <| Button "Save" OnSave True
}


type alias Model =
Basics.Bool

Modal model (active or not).


type Size
    = Small
    | Medium
    | Big

Modal size.

Functions

default : msg -> msg -> String -> Html msg -> Config msg

Default configuration for the modal view.

view : Config msg -> Model -> Html msg

Modal view.