> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-framework/modularity/ui-compatibility/reference/components/tooltip.md).

# Tooltip

Provides interactive tooltips that appear on hover over HTML elements.

## Syntax

```boxlang
<bx:tooltip 
    tooltip="string"
    autoDismissDelay="number"
    hideDelay="number"
    preventOverlap="boolean"
    showDelay="number"
    sourceForTooltip="string"
    style="string"
    id="string"
    class="string">
    <!-- Body content that triggers the tooltip -->
</bx:tooltip>
```

## Attributes

| Attribute          | Type      | Required | Description                                              | Default        |
| ------------------ | --------- | -------- | -------------------------------------------------------- | -------------- |
| `tooltip`          | `string`  | No\*     | Text displayed in the tooltip; can include HTML          | `""`           |
| `autoDismissDelay` | `number`  | No       | Time in milliseconds after which tooltip auto-disappears | `0`            |
| `hideDelay`        | `number`  | No       | Delay time before tooltip hides after mouse moves away   | `300`          |
| `preventOverlap`   | `boolean` | No       | Prevent tooltip from overlapping the component           | `false`        |
| `showDelay`        | `number`  | No       | Delay before tooltip appears after hovering              | `500`          |
| `sourceForTooltip` | `string`  | No\*     | URL for dynamic content to display in tooltip            | `""`           |
| `style`            | `string`  | No       | CSS styles for custom tooltip appearance                 | `""`           |
| `id`               | `string`  | No       | HTML element ID                                          | Auto-generated |
| `class`            | `string`  | No       | Additional CSS classes                                   | `""`           |

**Note:** Either `tooltip` or `sourceForTooltip` is required.

## Examples

### Basic tooltip with text

```boxlang
<bx:tooltip tooltip="This is a helpful tooltip" showDelay="500">
    Hover over me!
</bx:tooltip>
```

### Tooltip with dynamic content

```boxlang
<bx:tooltip sourceForTooltip="tooltip-content.bxm" hideDelay="200">
    <button>More Info</button>
</bx:tooltip>
```

### Styled tooltip

```boxlang
<bx:tooltip 
    tooltip="<b>Important:</b> This action cannot be undone"
    autoDismissDelay="5000"
    preventOverlap="true"
    style="background-color: #fff3cd; color: #856404; border: 1px solid #ffc107;">
    <span class="warning-icon">⚠️</span>
</bx:tooltip>
```

## Usage Notes

* The tooltip is triggered by hovering over the body content of the component
* Tooltip content wraps around the element it should trigger on
* Supports both static text and dynamic content via `sourceForTooltip`
* Requires BoxLang AJAX JavaScript files (use `<bx:ajaximport>`)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-framework/modularity/ui-compatibility/reference/components/tooltip.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
