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

Floating overlay -- positions child with optional translation and scaling.

## Props

- `translate_x` (number) -- horizontal translation in pixels. Default: 0.
- `translate_y` (number) -- vertical translation in pixels. Default: 0.
- `scale` (number) -- scale factor for the child content.
- `a11y` (map) -- accessibility overrides. See `Toddy.Iced.A11y`.

# `option`

```elixir
@type option() ::
  {:translate_x, number()}
  | {:translate_y, number()}
  | {:scale, number()}
  | {:a11y, Toddy.Iced.A11y.t()}
```

# `t`

```elixir
@type t() :: %Toddy.Iced.Widget.Float{
  a11y: Toddy.Iced.A11y.t() | nil,
  children: [Toddy.Iced.ui_node() | struct()],
  id: String.t(),
  scale: number() | nil,
  translate_x: number() | nil,
  translate_y: number() | nil
}
```

# `a11y`

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

Sets accessibility annotations.

# `build`

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

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

# `extend`

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

Appends multiple children to the float.

# `new`

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

Creates a new float struct with optional keyword opts.

# `push`

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

Appends a child to the float.

# `scale`

```elixir
@spec scale(float_widget :: t(), scale :: number()) :: t()
```

Sets the scale factor.

# `translate_x`

```elixir
@spec translate_x(float_widget :: t(), translate_x :: number()) :: t()
```

Sets the horizontal translation in pixels.

# `translate_y`

```elixir
@spec translate_y(float_widget :: t(), translate_y :: number()) :: t()
```

Sets the vertical translation in pixels.

# `with_options`

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

Applies keyword options to an existing float struct.

---

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