# `Plushie.Widget.Floating`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.6.0/lib/plushie/widget/floating.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.
- `width` (length) -- float width. See `Plushie.Type.Length`.
- `height` (length) -- float height. See `Plushie.Type.Length`.
- `a11y` (map) -- accessibility overrides. See `Plushie.Type.A11y`.

# `option`

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

# `t`

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

# `a11y`

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

Sets accessibility annotations.

# `build`

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

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

# `extend`

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

Appends multiple children to the float.

# `height`

```elixir
@spec height(floating :: t(), height :: Plushie.Type.Length.t()) :: t()
```

Sets the float height.

# `new`

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

Creates a new float struct with optional keyword opts.

# `push`

```elixir
@spec push(floating :: t(), child :: Plushie.Widget.child()) :: t()
```

Appends a child to the float.

# `scale`

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

Sets the scale factor.

# `translate_x`

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

Sets the horizontal translation in pixels.

# `translate_y`

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

Sets the vertical translation in pixels.

# `width`

```elixir
@spec width(floating :: t(), width :: Plushie.Type.Length.t()) :: t()
```

Sets the float width.

# `with_options`

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

Applies keyword options to an existing float struct.

---

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