elm-community/typed-svg/1.0.0

NOTE: this package is not compatible with Elm 0.19.1

TypedSvg.Core

SVG Nodes

type alias Svg msg =
Node msg

The core building block to create SVG. This library is filled with helper functions to create these Svg values.

text : String -> Svg msg

A simple text node, no tags at all. Warning: not to be confused with text_ which produces the SVG <text> tag!

node : String -> List (Attribute msg) -> List (Svg msg) -> Svg msg

Create any SVG node. To create a <rect> helper function, you would write: rect : List (Attribute msg) -> List (Svg msg) -> Svg msg rect attributes children = node "rect" attributes children You should always be able to use the helper functions already defined in this library though!

map : (a -> msg) -> Svg a -> Svg msg

Transform the messages produced by some Svg.

SVG Attributes

type alias Attribute msg =
Property msg

Set attributes on your Svg.

attribute : String -> String -> Attribute msg

Creates any untyped attribute

attributeNS : String -> String -> String -> Attribute msg

Creates any untyped, namespaced attribute

svgNamespace : Attribute msg