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

Size value for the `width` and `height` props on most widgets.

Maps to iced's `Length` enum. Accepts `:fill`, `:shrink`,
`{:fill_portion, n}`, or a numeric pixel value.

# `t`

```elixir
@type t() :: :fill | :shrink | {:fill_portion, pos_integer()} | number()
```

# `encode`

```elixir
@spec encode(length :: t()) :: String.t() | number() | map()
```

Encodes a length value to the wire format expected by the renderer.

## Examples

    iex> Toddy.Iced.Length.encode(:fill)
    "fill"

    iex> Toddy.Iced.Length.encode(:shrink)
    "shrink"

    iex> Toddy.Iced.Length.encode({:fill_portion, 3})
    %{"fill_portion" => 3}

    iex> Toddy.Iced.Length.encode(200)
    200

---

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