canceraiddev/elm-dialog/1.0.0

NOTE: the latest version is 2.0.0

Dialog

Simple Dialog.

We recommend checking out the examples to get a feel for how it works.

Model

type alias Model body msg =
Maybe (Dialog body msg)

Dialog Model data type.

type alias Dialog body msg =
Dialog body msg

Dialog data type.

{ title : String
, message : String
}
-> Dialog body msg

Create an error dialog.

{ title : String
, message : String
}
-> Error body
-> Dialog body msg

Create a httpError dialog.

{ title : String
, message : String
}
-> Dialog body msg

Create an info dialog.

loading : Dialog body msg

Create a loading dialog.

{ title : String
, message : String
, ok : msg
, cancel : msg
}
-> Dialog body msg

Create an OK/Cancel dialog.

Configuration

type alias Customizations body msg =
{ viewLoadingIndicator : Html msg
, viewHttpError : Error body -> Html msg
, toMsg : Msg -> msg
}

Customizations for dialog.

Use viewLoadingIndicator to set a custom loading icon, e.g. a .gif or custom HTML element.

Use viewHttpError to render Http.Detailed.Error messages.

Update

type alias Msg =
Msg

Opaque type representing the messages of the Dialog.

update : Msg -> Model body msg -> ( Model body msg, Cmd Msg )

Update dialog.