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

Spacing value for the `padding` prop on containers, buttons, and text inputs.

Maps to iced's `Padding` struct. Accepts a uniform number,
a `{vertical, horizontal}` tuple, or an explicit four-side map.
`encode/1` always normalises to the full four-side map.

# `t`

```elixir
@type t() ::
  number()
  | {number(), number()}
  | %{top: number(), right: number(), bottom: number(), left: number()}
```

# `encode`

```elixir
@spec encode(padding :: t()) :: map()
```

Normalises a padding value to the canonical four-side map with string keys.

## Examples

    iex> Toddy.Iced.Padding.encode(8)
    %{"top" => 8, "right" => 8, "bottom" => 8, "left" => 8}

    iex> Toddy.Iced.Padding.encode({4, 12})
    %{"top" => 4, "right" => 12, "bottom" => 4, "left" => 12}

    iex> Toddy.Iced.Padding.encode(%{top: 1, right: 2, bottom: 3, left: 4})
    %{"top" => 1, "right" => 2, "bottom" => 3, "left" => 4}

---

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