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

Responsive layout -- adapts to available size by reporting resize events.

The renderer wraps child content in a sensor that sends
`%Sensor{type: :resize, id: id, width: w, height: h}` events so the
Elixir app can adjust its view based on the measured size.

## Props

- `width` (length) -- container width. Default: fill. See `Toddy.Iced.Length`.
- `height` (length) -- container height. Default: fill.
- `a11y` (map) -- accessibility overrides. See `Toddy.Iced.A11y`.

# `option`

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

# `t`

```elixir
@type t() :: %Toddy.Iced.Widget.Responsive{
  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
}
```

# `a11y`

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

Sets accessibility annotations.

# `build`

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

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

# `extend`

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

Appends multiple children to the responsive container.

# `height`

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

Sets the container height.

# `new`

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

Creates a new responsive struct with optional keyword opts.

# `push`

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

Appends a child to the responsive container.

# `width`

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

Sets the container width.

# `with_options`

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

Applies keyword options to an existing responsive struct.

---

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