lenards/elm-ui-patternfly/2.1.0

NOTE: the latest version is 4.0.2

PF6.NotificationDrawer

PF6 NotificationDrawer component

The notification drawer is a slide-out panel that displays a list of notifications, alerts, and messages. Typically triggered by a bell icon in the masthead.

See: https://www.patternfly.org/components/notification-drawer

Definition

Opaque NotificationDrawer type

A single notification entry

type Variant

Notification severity variant

Constructor

{ isOpen : Bool
, items : List (NotificationItem msg)
, onClose : msg
}

Construct a NotificationDrawer

notificationDrawer
    { isOpen = model.notifDrawerOpen
    , items = [ item1, item2 ]
    , onClose = NotifDrawerClose
    }

Item constructor

Construct a notification item

notificationItem "Deployment complete"

Item modifiers

Set the notification item title

Set a timestamp string

Mark the item as read

Mark the item as unread (default)

Set the severity variant explicitly

Success variant

Warning variant

Danger variant

Info variant

Behavior

Set a message to send when the item is marked as read

Set a message to send when the item is cleared/dismissed

Set a message to send when "Mark all read" is clicked

Header

Replace the default header with a custom element

Rendering

toMarkup : NotificationDrawer msg -> Element msg

Render the NotificationDrawer as an Element msg

When isOpen is False, nothing is rendered. When True, a fixed-width panel is rendered on the right side. Use Element.inFront or a layout column to position it alongside your main content.