# `Visualize.SVG.Element`
[🔗](https://github.com/dcoai/Visualize/blob/v0.8.3/lib/visualize/svg/element.ex#L1)

Represents an SVG element as an Elixir data structure.

Elements can be nested and rendered to SVG strings or used directly
in LiveView templates.

# `t`

```elixir
@type t() :: %Visualize.SVG.Element{
  attrs: map(),
  children: [t()],
  content: String.t() | nil,
  tag: atom()
}
```

# `append`

```elixir
@spec append(t(), t() | Visualize.IR.Element.t() | [t() | Visualize.IR.Element.t()]) ::
  t()
```

Appends a child element. Also accepts IR.Element which will be converted.

# `attrs`

```elixir
@spec attrs(t(), map() | keyword()) :: t()
```

Sets attributes on an element.

# `circle`

# `clipPath`

# `content`

```elixir
@spec content(t(), String.t()) :: t()
```

Sets text content for the element.

# `defs`

# `ellipse`

# `from_ir`

```elixir
@spec from_ir(Visualize.IR.Element.t()) :: t()
```

Converts an IR.Element to an SVG.Element.

# `g`

# `line`

# `linearGradient`

# `new`

```elixir
@spec new(atom(), map()) :: t()
```

Creates a new SVG element.

## Examples

    iex> Visualize.SVG.Element.new(:rect, %{x: 0, y: 0, width: 100, height: 50})
    %Visualize.SVG.Element{tag: :rect, attrs: %{x: 0, y: 0, width: 100, height: 50}, children: [], content: nil}

# `path`

# `polygon`

# `polyline`

# `radialGradient`

# `rect`

# `stop`

# `svg`

Common SVG element constructors.

# `text`

# `title`

# `tspan`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
