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

Tooltip -- shows a popup tip over child content on hover.

The `tip` argument becomes the `tip` prop.

## Props

- `tip` (string) -- tooltip text (set automatically from the `tip` argument).
- `position` (atom) -- tooltip position: `:top` (default), `:bottom`,
  `:left`, `:right`, `:follow_cursor` / `:follow`. See `Toddy.Iced.Position`.
- `gap` (number) -- gap between tooltip and content in pixels.
- `padding` (number) -- tooltip padding in pixels (uniform, not per-side).
- `snap_within_viewport` (boolean) -- keep tooltip within viewport. Default: true.
- `delay` (non_neg_integer) -- delay in milliseconds before showing the tooltip.
- `style` (atom) -- named style (uses container styles). One of:
  `:transparent`, `:rounded_box`, `:bordered_box`, `:dark`, `:primary`,
  `:secondary`, `:success`, `:danger`, `:warning`.
- `a11y` (map) -- accessibility overrides. See `Toddy.Iced.A11y`.

# `option`

```elixir
@type option() ::
  {:position, Toddy.Iced.Position.t()}
  | {:gap, number()}
  | {:padding, number()}
  | {:snap_within_viewport, boolean()}
  | {:delay, non_neg_integer()}
  | {:style, style()}
  | {:a11y, Toddy.Iced.A11y.t()}
```

# `preset`

```elixir
@type preset() :: Toddy.Iced.Widget.Container.preset()
```

# `style`

```elixir
@type style() :: preset() | Toddy.Iced.StyleMap.t()
```

# `t`

```elixir
@type t() :: %Toddy.Iced.Widget.Tooltip{
  a11y: Toddy.Iced.A11y.t() | nil,
  children: [Toddy.Iced.ui_node() | struct()],
  delay: non_neg_integer() | nil,
  gap: number() | nil,
  id: String.t(),
  padding: number() | nil,
  position: Toddy.Iced.Position.t() | nil,
  snap_within_viewport: boolean() | nil,
  style: style() | nil,
  tip: String.t()
}
```

# `a11y`

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

Sets accessibility annotations.

# `build`

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

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

# `delay`

```elixir
@spec delay(tooltip :: t(), delay :: non_neg_integer()) :: t()
```

Sets the tooltip delay in milliseconds before showing.

# `extend`

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

Appends multiple children to the tooltip.

# `gap`

```elixir
@spec gap(tooltip :: t(), gap :: number()) :: t()
```

Sets the gap between tooltip and content.

# `new`

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

Creates a new tooltip struct with the given tip text and optional keyword opts.

# `padding`

```elixir
@spec padding(tooltip :: t(), padding :: number()) :: t()
```

Sets the tooltip padding.

# `position`

```elixir
@spec position(tooltip :: t(), position :: Toddy.Iced.Position.t()) :: t()
```

Sets the tooltip position.

# `push`

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

Appends a child to the tooltip.

# `snap_within_viewport`

```elixir
@spec snap_within_viewport(tooltip :: t(), snap :: boolean()) :: t()
```

Sets whether the tooltip snaps within the viewport.

# `style`

```elixir
@spec style(tooltip :: t(), style :: style()) :: t()
```

Sets the tooltip style.

# `with_options`

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

Applies keyword options to an existing tooltip struct.

---

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