mbr/elm-extras/3.1.0

Extras.Svg

Conditional rendering helpers for Svg.Svg.

The names follow the corresponding functions in Html.Extra.

nothing : Svg msg

Empty SVG content.

viewIf : Bool -> Svg msg -> Svg msg

Render SVG content when the condition is true.

viewIf showLabel (text "Label")
viewMaybe : (a -> Svg msg) -> Maybe a -> Svg msg

Render a present value as SVG content.

viewMaybe viewIcon selectedIcon