lenards/elm-ui-patternfly/2.1.0

NOTE: the latest version is 4.0.2

PF6.Tooltip

PF6 Tooltip component

Tooltips display a short description when a user hovers over or focuses an element.

See: https://www.patternfly.org/components/tooltip

Definition

type Tooltip msg

Opaque Tooltip type

Tooltip position relative to the trigger element

Constructor

{ trigger : Element msg
, content : String
}
-> Tooltip msg

Construct a Tooltip

tooltip
    { trigger = myButton
    , content = "This action cannot be undone"
    }

Position modifiers

withTop : Tooltip msg -> Tooltip msg

Position tooltip above the trigger (default)

Position tooltip below the trigger

withLeft : Tooltip msg -> Tooltip msg

Position tooltip to the left of the trigger

Position tooltip to the right of the trigger

Display modifiers

withMaxWidth : Int -> Tooltip msg -> Tooltip msg

Set max width in pixels (default 300)

Rendering

toMarkup : Tooltip msg -> Element msg

Render the Tooltip as an Element msg

The tooltip bubble is hidden by default (opacity: 0) and shown on hover via an injected CSS rule. The bubble is positioned using elm-ui's above/below/onLeft/onRight attributes with an 8px gap.