---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/examples/cases/balloon_and_hint.md
  - https://yandex.com/dev/jsapi-v2-1/doc/ru/v2-1/examples/cases/balloon_and_hint.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/jsapi-v2-1/doc/en/llms.txt

# Balloon and hint

<iframe id="LIVE-EXAMPLE" style="width:100%;height: 400px;border-radius: 8px;border: 1px solid rgba(92, 94, 102, 0.14);" frameBorder="0" src="https://yastatic.net/s3/front-maps-static/maps-front-jsapi-v2-1/examples/2/out/s3-cases/en/balloon_and_hint/index.html" allow="fullscreen"></iframe>

<a target="_blank" rel="noopener noreferrer" style="display: inline-block;margin-top: 10px;cursor: pointer;border-radius: 4px;padding: 9px 12px;background: #151515;color: white;text-decoration: none;font-weight: 500" href="https://codesandbox.io/p/sandbox/tc48v3?file=index.html">Open in CodeSandbox</a>

<div id="references">
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/ready">ready</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map">Map</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Balloon">map.Balloon</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Hint">map.Hint</a>,
    <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Placemark">Placemark</a>
</div>
<p>
   On the map you can display
   the <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/dg/concepts/map#balloon_and_hint">balloon and hint</a>.
</p>
<p>
    Links to the balloon and hint managers are contained in the
<a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map#balloon">balloon</a>
    and <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/Map#hint">hint</a> fields of the map object.
    The managers are implemented as the <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Balloon">map.Balloon</a> and <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/map.Hint">map.Hint</a> classes,
    but <strong>don't create instances of these classes yourself</strong> —
    use the corresponding fields of the map object.
</p>
<p>
    The <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/dg/concepts/geoobjects">geo objects</a> and other entities on the map have access to the balloon and hint.
    Use the <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/GeoObject#constructor-summary">corresponding properties and options</a>
    (the <code>balloon</code> and <code>hint</code>)  prefixes) to describe the balloon and hint of a geo object/hotspot.
    The coordinates of the balloon and the hint will be calculated automatically.
</p>

{% list tabs %}

-   index.html

    ```html
    <!DOCTYPE html>
    <html>
        <head>
            <title>Examples. Balloon and hint</title>
            <meta
                http-equiv="Content-Type"
                content="text/html; charset=UTF-8"
            />
            <!--
            Set your own API-key. Testing key is not valid for other web-sites and services.
            Get your API-key on the Developer Dashboard: https://developer.tech.yandex.ru/keys/
        -->
            
            
            
        </head>
        <body>
            <div id="map"></div>
        </body>
    </html>
    ```

-   balloon_and_hint.js

    ```js
    ymaps.ready(init);

    function init() {
        var myMap = new ymaps.Map(
                "map",
                {
                    center: [54.83, 37.11],
                    zoom: 5,
                },
                {
                    searchControlProvider: "yandex#search",
                }
            ),
            myPlacemark = new ymaps.Placemark([55.907228, 31.260503], {
                // In order for the balloon and hint to open on the placemark, you need to set certain properties.
                balloonContentHeader: "The placemark balloon",
                balloonContentBody: "Content of the <em>placemark</em> balloon",
                balloonContentFooter: "Basement",
                hintContent: "The placemark hint",
            });

        myMap.geoObjects.add(myPlacemark);

        // Opening the balloon on the map (without binding to the geo object).
        myMap.balloon.open([51.85, 38.37], "Balloon content", {
            // Option: do not show the close button.
            closeButton: false,
        });

        // Showing the hint on the map (without binding to the geo object).
        myMap.hint.open(myMap.getCenter(), "Lone hint without a placemark", {
            // Option: delay before opening.
            openTimeout: 1500,
        });
    }
    ```

{% endlist %}
