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

Pin layout -- positions child at absolute coordinates.

## Props

- `x` (number) -- x position in pixels. Default: 0.
- `y` (number) -- y position in pixels. Default: 0.
- `width` (length) -- pin container width. Default: shrink. See `Toddy.Iced.Length`.
- `height` (length) -- pin container height. Default: shrink.
- `a11y` (map) -- accessibility overrides. See `Toddy.Iced.A11y`.

# `option`

```elixir
@type option() ::
  {:x, number()}
  | {:y, number()}
  | {:width, Toddy.Iced.Length.t()}
  | {:height, Toddy.Iced.Length.t()}
  | {:a11y, Toddy.Iced.A11y.t()}
```

# `t`

```elixir
@type t() :: %Toddy.Iced.Widget.Pin{
  a11y: Toddy.Iced.A11y.t() | nil,
  children: [Toddy.Iced.ui_node() | struct()],
  height: Toddy.Iced.Length.t() | nil,
  id: String.t(),
  width: Toddy.Iced.Length.t() | nil,
  x: number() | nil,
  y: number() | nil
}
```

# `a11y`

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

Sets accessibility annotations.

# `build`

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

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

# `extend`

```elixir
@spec extend(pin :: t(), children :: [Toddy.Iced.ui_node() | struct()]) :: t()
```

Appends multiple children to the pin.

# `height`

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

Sets the pin container height.

# `new`

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

Creates a new pin struct with optional keyword opts.

# `push`

```elixir
@spec push(pin :: t(), child :: Toddy.Iced.ui_node() | struct()) :: t()
```

Appends a child to the pin.

# `width`

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

Sets the pin container width.

# `with_options`

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

Applies keyword options to an existing pin struct.

# `x`

```elixir
@spec x(pin :: t(), x :: number()) :: t()
```

Sets the x position in pixels.

# `y`

```elixir
@spec y(pin :: t(), y :: number()) :: t()
```

Sets the y position in pixels.

---

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