# `Toddy.Iced.Widget.Svg`
[🔗](https://github.com/toddy-ui/toddy-elixir/blob/v0.3.0/lib/toddy/iced/widget/svg.ex#L1)

SVG display -- renders a vector image from a file path.

## Props

- `source` (string) -- path to the SVG file.
- `width` (length) -- SVG width. Default: shrink. See `Toddy.Iced.Length`.
- `height` (length) -- SVG height. Default: shrink.
- `content_fit` -- how the SVG fits its bounds. See `Toddy.Iced.ContentFit`.
- `rotation` (number) -- rotation angle in degrees.
- `opacity` (number) -- opacity from 0.0 (transparent) to 1.0 (opaque).
- `color` (color) -- color tint applied to the SVG. See `Toddy.Iced.Color`.
- `alt` (string) -- alt text for the SVG (accessibility).
- `description` (string) -- longer description for the SVG (accessibility).
- `a11y` (map) -- accessibility overrides. See `Toddy.Iced.A11y`.

# `option`

```elixir
@type option() ::
  {:width, Toddy.Iced.Length.t()}
  | {:height, Toddy.Iced.Length.t()}
  | {:content_fit, Toddy.Iced.ContentFit.t()}
  | {:rotation, number()}
  | {:opacity, number()}
  | {:color, Toddy.Iced.Color.input()}
  | {:alt, String.t()}
  | {:description, String.t()}
  | {:a11y, Toddy.Iced.A11y.t()}
```

# `t`

```elixir
@type t() :: %Toddy.Iced.Widget.Svg{
  a11y: Toddy.Iced.A11y.t() | nil,
  alt: String.t() | nil,
  color: Toddy.Iced.Color.t() | nil,
  content_fit: Toddy.Iced.ContentFit.t() | nil,
  description: String.t() | nil,
  height: Toddy.Iced.Length.t() | nil,
  id: String.t(),
  opacity: number() | nil,
  rotation: number() | nil,
  source: String.t(),
  width: Toddy.Iced.Length.t() | nil
}
```

# `a11y`

```elixir
@spec a11y(svg :: t(), a11y :: Toddy.Iced.A11y.t()) :: t()
```

Sets accessibility annotations.

# `alt`

```elixir
@spec alt(svg :: t(), alt :: String.t()) :: t()
```

Sets the alt text for the SVG.

# `build`

```elixir
@spec build(svg :: t()) :: Toddy.Iced.ui_node()
```

Converts this SVG struct to a `ui_node()` map via the `Toddy.Iced.Widget` protocol.

# `color`

```elixir
@spec color(svg :: t(), color :: Toddy.Iced.Color.input()) :: t()
```

Sets the color tint applied to the SVG.

# `content_fit`

```elixir
@spec content_fit(svg :: t(), content_fit :: Toddy.Iced.ContentFit.t()) :: t()
```

Sets how the SVG fits its bounds.

# `description`

```elixir
@spec description(svg :: t(), description :: String.t()) :: t()
```

Sets a longer description for the SVG.

# `height`

```elixir
@spec height(svg :: t(), height :: Toddy.Iced.Length.t()) :: t()
```

Sets the SVG height.

# `new`

```elixir
@spec new(id :: String.t(), source :: String.t(), opts :: [option()]) :: t()
```

Creates a new SVG struct with the given source path and optional keyword opts.

# `opacity`

```elixir
@spec opacity(svg :: t(), opacity :: number()) :: t()
```

Sets the SVG opacity.

# `rotation`

```elixir
@spec rotation(svg :: t(), rotation :: number()) :: t()
```

Sets the rotation angle in degrees.

# `width`

```elixir
@spec width(svg :: t(), width :: Toddy.Iced.Length.t()) :: t()
```

Sets the SVG width.

# `with_options`

```elixir
@spec with_options(svg :: t(), opts :: [option()]) :: t()
```

Applies keyword options to an existing SVG struct.

---

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