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

# Placemark and balloon panel

<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/placemark_balloon/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/v9pgm2?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/Placemark">Placemark</a>, <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/option.presetStorage">option.presetStorage</a>
</div>
<p>
    In this example, a placemark is added to the map that, when clicked, opens a balloon panel with the specified content.
</p>
<p>
    To set the placemark style from a <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/option.presetStorage">set of built-in styles</a>, use the <b>preset</b> option.
    The API has five preset styles for placemarks (the corresponding keys are shown in parentheses):
    <ul>
       <li>placemarks with text ('islands#icon');</li>
       <li>placemarks that stretch to fit the text ('islands#stretchyIcon');</li>
       <li>placemarks with a dot in the center ('islands#dotIcon');</li>
       <li>placemarks in the form of circles ('islands#circleIcon');</li>
       <li>placemarks in the form of circles with a dot in the center ('islands#circleDotIcon').</li>
    </ul>
</p>
<p>
    For each style there are 16 colors. The API allows you to also specify custom colors for placemarks for all styles, except 'islands#stretchyIcon'.
       For information on how to set custom colors for placemarks, see the following <a href="https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/examples/cases/icon_customImage">example</a>.
</p>

{% list tabs %}

-   index.html

    ```html
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <title>Examples. Placemark and balloon panel.</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 class="hero-unit">
                <div class="container">
                    <div id="YMapsID"></div>
                </div>
            </div>
        </body>
    </html>
    ```

-   placemark_balloon.js

    ```js
    ymaps.ready(function () {
        var myMap = new ymaps.Map("YMapsID", {
            center: [55.733835, 37.588227],
            zoom: 12,
            /**
             * Please note that in the API 2.1, the map is created with controls by default.
             * If you don't need to add them to the map, pass an empty array in the "controls" field in its parameters.
             */
            controls: [],
        });

        var myPlacemark = new ymaps.Placemark(
            myMap.getCenter(),
            {
                balloonContentBody: [
                    "<address>",
                    "<strong>Yandex office in Moscow</strong>",
                    "<br/>",
                    "Address: 119021, Moscow, Lva Tolstogo Street, 16",
                    "<br/>",
                    'For more information, see: <a href="https://company.yandex.com">https://company.yandex.com</a>',
                    "</address>",
                ].join(""),
            },
            {
                preset: "islands#redDotIcon",
            }
        );

        myMap.geoObjects.add(myPlacemark);
    });
    ```

{% endlist %}
