Orasund/elm-ui-widgets/1.0.0

NOTE: the latest version is 3.4.0

Widget

This module contains functions for displaying data.

{ selected : Maybe a
, options : List a
, label : a -> Element msg
, onChange : a -> msg
, attributes : Bool -> List (Attribute msg)
}
-> List (Element msg)

Selects one out of multiple options. This can be used for radio buttons or Menus.

{ selected : Set comparable
, options : List comparable
, label : comparable -> Element msg
, onChange : comparable -> msg
, attributes : Bool -> List (Attribute msg)
}
-> List (Element msg)

Selects multible options. This can be used for checkboxes.

{ onToggle : Bool -> msg
, isCollapsed : Bool
, label : Element msg
, content : Element msg
}
-> Element msg

Some collapsable content.

    Widget.collapsable
        {onToggle = ToggleCollapsable
        ,isCollapsed = model.isCollapsed
        ,label = Element.row Grid.compact
            [ Element.html <|
                if model.isCollapsed then
                    Heroicons.cheveronRight  [ Attributes.width 20]
                else
                    Heroicons.cheveronDown [ Attributes.width 20]
            , Element.el Heading.h4 <|Element.text <| "Title"
            ]
        ,content = Element.text <| "Hello World"
        }
{ onDismiss : Maybe msg
, content : Element msg
}
-> Element msg

A dialog element displaying important information.

    Framework.Layout
        [ Element.inFront <|
            if model.displayDialog then
                Widget.dialog
                    { onDismiss = Just <| ToggleDialog False
                    , content =
                        [ "This is a dialog window"
                            |> Element.text
                        , Input.button []
                            {onPress = Just <| ToggleDialog False
                            , label = Element.text "Ok"
                            }
                        ]
                        |> Element.column []
                    }
            else Element.none
        ] <|
            Element.text "some Content"
tab :
List (Attribute msg)
-> { selected : a
, options : List a
, onChange : a -> msg
, label : a -> Element msg
, content : a -> Element msg
, attributes : Bool -> List (Attribute msg)
}
-> Element msg

Displayes a list of contents in a tab