perzanko / elm-loading / Loading

Config


type alias Config =
{ size : Basics.Float
, color : String
, className : String
, speed : Basics.Float 
}

Loader types

You can choose one of these loaders:


type LoaderType
    = DoubleBounce
    | Spinner
    | BouncingBalls
    | Bars
    | Circle
    | Sonar

Loading states

The loaders will be rendered according on the LoadingState. If you pass Loading.On loader will be displayed, if Loading.Off loader will be hidden (will not be hidden by css, only node will be removed).


type LoadingState
    = On
    | Off

Default config

defaultConfig : Config

Render loader

Loading.render takes 3 arguments: LoaderType, Config, LoadingState.

render : LoaderType -> Config -> LoadingState -> Html a

view : Model -> Html Msg
view model =
    div []
        [ Loading.render
            DoubleBounce
            { defaultConfig | color = "#333" }
            Loading.On
        ]