This module is useful if you want to add a ToolTip to your app.
} } Init a ToolTip.Model in your model.
myInitialModel : MyModel
myInitialModel =
{ myToolTip = ToolTip.init
}Add a ToolTip.Msg to your Msg.
type MyMsg
= UpdateMyToolTip ToolTip.MsgUse in your update function.
myUpdate : Msg -> Model -> ( Model, Cmd Msg )
myUpdate msg model =
case msg of
UpdateMyToolTip toolTipMsg ->
let
( newToolTip, cmd ) =
ToolTip.update toolTipMsg mode.myToolTip
in
{ model | myToolTip = newToolTip } ! [ cmd ]Transform an ToolTip.Model into an ToolTip.View, which allows us to pipe View Setters on it.
myView : Model -> Html Msg
myView model =
div
[]
[ ToolTip.view model.myToolTip -- pipe view setters here, for example |> setPlacement Top
]Transforms an ToolTip.View into Html ToolTip.Msg
myView : Model -> Html Msg
myView model =
div
[]
[ ToolTip.render model.myToolTip
|> Html.map UpdateMyToolTip
]Render the tip above the content
Render the tip left of the content
Render the tip below the content
Make the ToolTip green
Make the ToolTip red
Make the ToolTip blue
Add a ToolTip.Model to your model.