# `Plushie.Widget.Responsive`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.6.0/lib/plushie/widget/responsive.ex#L1)

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

The renderer wraps child content in a sensor that sends
`%WidgetEvent{type: :resize, id: id, data: %{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 `Plushie.Type.Length`.
- `height` (length) -- container height. Default: fill.
- `a11y` (map) -- accessibility overrides. See `Plushie.Type.A11y`.

# `option`

```elixir
@type option() ::
  {:width, Plushie.Type.Length.t()}
  | {:height, Plushie.Type.Length.t()}
  | {:a11y, Plushie.Type.A11y.t() | map() | keyword()}
```

# `t`

```elixir
@type t() :: %Plushie.Widget.Responsive{
  a11y: Plushie.Type.A11y.t() | nil,
  children: [Plushie.Widget.child()],
  height: Plushie.Type.Length.t() | nil,
  id: String.t(),
  width: Plushie.Type.Length.t() | nil
}
```

# `a11y`

```elixir
@spec a11y(responsive :: t(), a11y :: Plushie.Type.A11y.t() | map() | keyword()) ::
  t()
```

Sets accessibility annotations.

# `build`

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

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

# `extend`

```elixir
@spec extend(
  responsive :: t(),
  children :: [Plushie.Widget.child()]
) :: t()
```

Appends multiple children to the responsive container.

# `height`

```elixir
@spec height(responsive :: t(), height :: Plushie.Type.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 :: Plushie.Widget.child()) :: t()
```

Appends a child to the responsive container.

# `width`

```elixir
@spec width(responsive :: t(), width :: Plushie.Type.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*
