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.Element

Description

Overview

Miso.Svg.Element provides smart constructors for every element in the SVG vocabulary. All nodes are created in the SVG namespace via document.createElementNS("http://www.w3.org/2000/svg", …). This module is re-exported in its entirety by Miso.Svg.

Leaf elements (shapes, images, stops, …) omit the children argument:

circle_ :: [Attribute action] -> View model action

Container elements accept both attributes and children:

g_ :: [Attribute action] -> [View model action] -> View model action

Quick start

import Miso
import Miso.Svg
import qualified Miso.Svg.Property as SP

logo :: View model action
logo =
  svg_ [ SP.viewBox_ "0 0 200 200", SP.width_ "200" ]
    [ g_ [ SP.fill_ "none", SP.stroke_ "black" ]
        [ circle_ [ SP.cx_ "100", SP.cy_ "100", SP.r_ "80" ]
        , line_   [ SP.x1_ "20", SP.y1_ "100"
                    , SP.x2_ "180", SP.y2_ "100" ]
        ]
    , text_ [ SP.x_ "100", SP.y_ "110"
              , SP.textAnchor_ "middle" ]
              [ text "miso" ]
    ]

Element groups

See also

Synopsis

SVG

svg_ :: [Attribute action] -> [View model action] -> View model action Source #

Graphics

circle_ :: [Attribute action] -> View model action Source #

ellipse_ :: [Attribute action] -> View model action Source #

image_ :: [Attribute action] -> View model action Source #

line_ :: [Attribute action] -> View model action Source #

path_ :: [Attribute action] -> View model action Source #

polygon_ :: [Attribute action] -> View model action Source #

polyline_ :: [Attribute action] -> View model action Source #

rect_ :: [Attribute action] -> View model action Source #

use_ :: [Attribute action] -> View model action Source #

Animation

animate_ :: [Attribute action] -> View model action Source #

mpath_ :: [Attribute action] -> View model action Source #

set_ :: [Attribute action] -> View model action Source #

Descriptive

desc_ :: [Attribute action] -> [View model action] -> View model action Source #

metadata_ :: [Attribute action] -> [View model action] -> View model action Source #

title_ :: [Attribute action] -> [View model action] -> View model action Source #

Containers

defs_ :: [Attribute action] -> [View model action] -> View model action Source #

g_ :: [Attribute action] -> [View model action] -> View model action Source #

marker_ :: [Attribute action] -> [View model action] -> View model action Source #

mask_ :: [Attribute action] -> [View model action] -> View model action Source #

pattern_ :: [Attribute action] -> [View model action] -> View model action Source #

switch_ :: [Attribute action] -> [View model action] -> View model action Source #

symbol_ :: [Attribute action] -> [View model action] -> View model action Source #

Text

textPath_ :: [Attribute action] -> [View model action] -> View model action Source #

text_ :: [Attribute action] -> [View model action] -> View model action Source #

tspan_ :: [Attribute action] -> [View model action] -> View model action Source #

Gradients

linearGradient_ :: [Attribute action] -> [View model action] -> View model action Source #

radialGradient_ :: [Attribute action] -> [View model action] -> View model action Source #

stop_ :: [Attribute action] -> View model action Source #

Filters

feBlend_ :: [Attribute action] -> View model action Source #

feComponentTransfer_ :: [Attribute action] -> [View model action] -> View model action Source #

feComposite_ :: [Attribute action] -> View model action Source #

feDiffuseLighting_ :: [Attribute action] -> [View model action] -> View model action Source #

feDropShadow_ :: [Attribute action] -> View model action Source #

<feDropShadow>

Since: 1.9.0.0

feFlood_ :: [Attribute action] -> View model action Source #

feFuncA_ :: [Attribute action] -> [View model action] -> View model action Source #

feFuncB_ :: [Attribute action] -> [View model action] -> View model action Source #

feFuncG_ :: [Attribute action] -> [View model action] -> View model action Source #

feFuncR_ :: [Attribute action] -> [View model action] -> View model action Source #

feImage_ :: [Attribute action] -> View model action Source #

feMerge_ :: [Attribute action] -> [View model action] -> View model action Source #

feMergeNode_ :: [Attribute action] -> View model action Source #

feMorphology_ :: [Attribute action] -> View model action Source #

<feMorphology>

Since: 1.9.0.0

feOffset_ :: [Attribute action] -> View model action Source #

feSpecularLighting_ :: [Attribute action] -> [View model action] -> View model action Source #

feTile_ :: [Attribute action] -> View model action Source #

feTurbulence_ :: [Attribute action] -> View model action Source #

Light source

feDistantLight_ :: [Attribute action] -> [View model action] -> View model action Source #

fePointLight_ :: [Attribute action] -> View model action Source #

feSpotLight_ :: [Attribute action] -> View model action Source #

Misc.

foreignObject_ :: [Attribute action] -> [View model action] -> View model action Source #

clipPath_ :: [Attribute action] -> [View model action] -> View model action Source #

filter_ :: [Attribute action] -> [View model action] -> View model action Source #

script_ :: [Attribute action] -> [View model action] -> View model action Source #

style_ :: [Attribute action] -> [View model action] -> View model action Source #

view_ :: [Attribute action] -> View model action Source #