elm-community/typed-svg/5.1.0

NOTE: the latest version is 7.0.0

TypedSvg.Events

Animation event attributes

onBegin : msg -> Attribute msg
onEnd : msg -> Attribute msg
onRepeat : msg -> Attribute msg

Document event attributes

onAbort : msg -> Attribute msg
onError : msg -> Attribute msg
onResize : msg -> Attribute msg
onScroll : msg -> Attribute msg
onLoad : msg -> Attribute msg
onUnload : msg -> Attribute msg
onZoom : msg -> Attribute msg

Graphical event attributes

onActivate : msg -> Attribute msg
onAuxClick : msg -> Attribute msg
onClick : msg -> Attribute msg
onContextMenu : msg -> Attribute msg
onDblClick : msg -> Attribute msg
onFocusIn : msg -> Attribute msg
onFocusOut : msg -> Attribute msg
onMouseDown : msg -> Attribute msg
onMouseEnter : msg -> Attribute msg
onMouseLeave : msg -> Attribute msg
onMouseMove : msg -> Attribute msg
onMouseOut : msg -> Attribute msg
onMouseOver : msg -> Attribute msg
onMouseUp : msg -> Attribute msg

Custom Events

on : String -> Handler msg -> Attribute msg

Create a custom event listener. import Json.Decode as Json onClick : msg -> Attribute msg onClick msg = on "click" (Json.succeed msg)

You first specify the name of the event in the same format as with JavaScript’s addEventListener. Next you give a JSON decoder, which lets you pull information out of the event object. If the decoder succeeds, it will produce a message and route it to your update function.