> For the complete documentation index, see [llms.txt](https://docs.boii.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.boii.dev/fivem-free-resources/bduk/core-ui/tooltip.md).

# Tooltip

<figure><img src="/files/5uhJqtDkEf7CUKcDUNx9" alt=""><figcaption></figcaption></figure>

The `tooltip` is a dynamic info panel that follows the mouse and displays contextual data for any UI element that has hover metadata.

It supports:

* **Title, description, and key-value fields**
* **Rarity styling**
* **Future keypress-based action hints**
* Full integration using `on_hover` blocks

***

## Structure

Tooltips are defined on any UI element via the `on_hover` table:

```lua
{
    title = "Card Info",
    description = {
        "Info descriptions can support arrays",
        "- like so",
        "- you get the idea"
    },
    values = {
        { key = "Key", value = "Value Pairs" },
        { key = "Name", value = "Case" }
    },
    actions = {
        { 
            id = "test_action", 
            key = "E", 
            label = "Action on Keypress", 
            on_action = function(data) ... end
        }
    },
    rarity = "common"
}
```

Attach this block using `on_hover` key in UI config.

***

## Rarity Themes

Tooltip headers adapt colours based on `rarity`. \
This uses `var(--rarity_x)` theming for visual identity.

| Value       | Style CSS Variable   |
| ----------- | -------------------- |
| `uncommon`  | `--rarity_uncommon`  |
| `common`    | `--rarity_common`    |
| `rare`      | `--rarity_rare`      |
| `epic`      | `--rarity_epic`      |
| `legendary` | `--rarity_legendary` |

```css
--rarity_common: rgba(255, 255, 255, 0.8);
--rarity_uncommon: rgba(38, 189, 38, 0.8);
--rarity_rare: rgba(66, 135, 245,  0.8);
--rarity_epic: rgba(119, 45, 189,  0.8);
--rarity_legendary: rgba(219, 144, 57,  0.8);
```

***

## Tooltip Sections

Each tooltip supports 4 sections:

| Section       | Description                                        |
| ------------- | -------------------------------------------------- |
| `title`       | The main tooltip title with optional rarity label. |
| `description` | Array of text lines shown as a paragraph block.    |
| `values`      | Key-value display for stats, attributes, etc.      |
| `actions`     | Shows a list of interactive keypresses.            |


---

# 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://docs.boii.dev/fivem-free-resources/bduk/core-ui/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.
