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.Native.X.Element.Svg

Contents

Description

<svg>

Displays SVG content supplied inline or by URL.

Since: 1.13.0.0

Synopsis

Element

svgWith_ Source #

Arguments

:: [Attribute model action] 
-> View context props model action

Inline SVG content, in the component's own context / props / model types

-> View context props model action 

An <svg> whose inline content is rendered against the enclosing component's context, props and model, so the content may itself use vcontext / vprops / vmodel. The values are obtained ambiently with withContext / withProps / withModel and passed to content_:

svgWith_ [ style_ [ width "100px" ] ] $
  Svg.svg_ [ textProp "xmlns" "http://www.w3.org/2000/svg" ]
    [ vmodel $ \Model { color } -> Svg.circle_ [ Svg.fill_ color ] [] ]

Compare content_, which takes the context, props and model to render against as explicit arguments.

Since: 1.14.0.0