lenards / elm-ui-patternfly / PF4.Badge

An element for showing off numbers in various scenarios

The PF4.Badge comes in handy when rendering notifications or alerts that have been "read" or "unread" in the form of a "pill" element since in other design systems.

Definition


type Badge

Opaque Badge element

Constructor functions

badge : Basics.Int -> Badge

Constructs a Badge

Default status of the Badge will be Read.

unreadBadge : Basics.Int -> Badge

Configures the Badge to have an Unread status

Configuration functions


type Status

Defines Status to be one of two values: Read or Unread

withReadStatus : Badge -> Badge

Configures Badge to have a Read status

withUnreadStatus : Badge -> Badge

Configures Badge to have a Unread status

Checking value

isRead : Badge -> Basics.Bool

Indicates if the status of the Badge is Read

isUnread : Badge -> Basics.Bool

Indicates if the status of the Badge is Unread

Rendering stateless element

toMarkup : Badge -> Element msg

Given the custom type representation, renders as an Element msg.