miso
Copyright(C) 2016-2026 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <code@dmj.io>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Svg.Event

Description

Overview

Miso.Svg.Event provides event-handler Attribute values for SVG-specific DOM events. All handlers use emptyDecoder — they fire a fixed action with no payload extracted from the event object. This module is re-exported by Miso.Svg.

For pointer and keyboard events on SVG elements, use the handlers from Miso.Html.Event directly — they work on any DOM element regardless of namespace.

Quick start

import Miso
import Miso.Svg

data Action = AnimDone | Zoomed

view :: Model -> View Model Action
view _ =
  svg_ []
    [ animate_
        [ onEnd  AnimDone
        , onZoom Zoomed
        ]
    , circle_
        [ onClick    Toggle
        , onMouseOver Highlight
        ]
    ]

Event groups

Note: onClick is re-exported from Miso.Html.Event and is identical to the HTML version.

See also

Synopsis

Animation

onBegin :: action -> Attribute action Source #

onBegin event

onEnd :: action -> Attribute action Source #

onEnd event

onRepeat :: action -> Attribute action Source #

onRepeat event

Document

onAbort :: action -> Attribute action Source #

onAbort event

onError :: action -> Attribute action Source #

onError event

onResize :: action -> Attribute action Source #

onResize event

onScroll :: action -> Attribute action Source #

onScroll event

onZoom :: action -> Attribute action Source #

onZoom event

Graphical

onActivate :: action -> Attribute action Source #

onActivate event

onFocusIn :: action -> Attribute action Source #

onFocusIn event

onFocusOut :: action -> Attribute action Source #

onFocusOut event

onMouseDown :: action -> Attribute action Source #

onMouseDown event

onMouseMove :: action -> Attribute action Source #

onMouseMove event

onMouseOut :: action -> Attribute action Source #

onMouseOut event

onMouseOver :: action -> Attribute action Source #

onMouseOver event

onMouseUp :: action -> Attribute action Source #

onMouseUp event