nathanjohnson320 / elm-ui-components / ElmUIC.Toast

A styled toast notification


type alias Toast =
{ kind : ElmUIC.Theme.ColorSetting
, size : ElmUIC.Theme.Size
, text : Css.Color
, z : Basics.Int
, position : Position
, visible : Basics.Bool
, transitionDirection : Position 
}

Base model for a toast


type Position
    = Top
    | Left
    | Bottom
    | Right
    | TopLeft
    | TopRight
    | BottomLeft
    | BottomRight

Possible screen positions for the toast

defaultToast : Toast

Instantiates the default properties of the toast

{ defaultToast | position = Top, visible = True }

toast : ElmUIC.Theme.Theme -> Toast -> List (Html.Styled.Attribute msg) -> List (Html.Styled.Html msg) -> Html.Styled.Html msg

A styled toast notification

toast
    defaultTheme
    { defaultToast
        | position = TopRight
        , transitionDirection = TopRight
        , visible = model.checked
    }
    []
    [ text "Notify things!" ]