# `Plushie.Canvas.Path`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/canvas/path.ex#L1)

Canvas arbitrary path element built from a list of drawing commands.

# `option`

```elixir
@type option() ::
  ((({:commands, [term()]} | {:fill, term()})
    | {:stroke,
       %Plushie.Canvas.Stroke{
         cap: term(),
         color: term(),
         dash: term(),
         join: term(),
         width: term()
       }
       | keyword()
       | map()})
   | {:opacity, number()})
  | {:fill_rule, String.t() | atom()}
```

# `t`

```elixir
@type t() :: %Plushie.Canvas.Path{
  commands:
    [term()]
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  fill:
    term()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  fill_rule:
    (String.t() | atom())
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  id: String.t() | nil,
  opacity:
    number()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  stroke:
    %Plushie.Canvas.Stroke{
      cap: term(),
      color: term(),
      dash: term(),
      join: term(),
      width: term()
    }
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil
}
```

# `build`

```elixir
@spec build(widget :: t()) :: Plushie.Widget.ui_node()
```

Converts this widget struct to a `ui_node()` map.

# `commands`

```elixir
@spec commands(widget :: t(), value :: [term()] | nil) :: t()
```

List of path commands (move_to, line_to, etc.).

Accepts `[term()]`.

# `fill`

```elixir
@spec fill(widget :: t(), value :: term() | nil) :: t()
```

Fill color or gradient.

Accepts `term()`.

# `fill_rule`

```elixir
@spec fill_rule(widget :: t(), value :: (String.t() | atom()) | nil) :: t()
```

Fill rule: "non_zero" or "even_odd".

Accepts `String.t() | atom()`.

# `new`

```elixir
@spec new(opts :: [option()]) :: t()
```

Creates a new element without an explicit ID (auto-assigned by parent container).

# `new`

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

Creates a new element with the given ID and keyword options.

# `opacity`

```elixir
@spec opacity(widget :: t(), value :: number() | nil) :: t()
```

Opacity from 0.0 to 1.0.

Accepts `number()`.

# `stroke`

```elixir
@spec stroke(
  widget :: t(),
  value ::
    (%Plushie.Canvas.Stroke{
       cap: term(),
       color: term(),
       dash: term(),
       join: term(),
       width: term()
     }
     | keyword()
     | map())
    | nil
) :: t()
```

Stroke descriptor.

Accepts `%Plushie.Canvas.Stroke{}`.

# `type_name`

```elixir
@spec type_name() :: String.t()
```

Returns the element type string for the wire protocol.

# `with_options`

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

Applies keyword options to an existing widget struct.

---

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