uncover-co/elm-widgets/2.4.0

NOTE: the latest version is 2.28.0

W.Badge

Badges are commonly used to display notifications.

List (Attribute msg)
-> { content : Maybe (List (Html msg))
, children : List (Html msg)
}
-> Html msg
W.Badge.view []
    { -- number of unread messages
      content = Just [ H.text "9" ]
    , -- call to action
      children =
        [ W.Button.viewLink []
            { href = "/messages"
            , label = [ H.text "Messages" ]
            }
        ]
    }
viewInline : List (Attribute msg) -> List (Html msg) -> Html msg
W.Badge.viewInline [] [ H.text "9" ]

Colors

By default, badges appear in a danger color.

color : String -> Attribute msg
background : String -> Attribute msg

Styles

Html

htmlAttrs : List (Attribute msg) -> Attribute msg
type Attribute msg