Badges are commonly used to display notifications.
view : 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" ]
By default, badges appear in a danger color.
neutral : Attribute msg
primary : Attribute msg
secondary : Attribute msg
success : Attribute msg
warning : Attribute msg
color : String -> Attribute msg
background : String -> Attribute msg
small : Attribute msg
htmlAttrs : List (Html.Attribute msg) -> Attribute msg
noAttr : Attribute msg