---
title: "setRTLTextPlugin | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Variable setRTLTextPlugin

setRTLTextPlugin: (pluginURL: string, lazy: boolean) \=> Promise<void\>

#### Type Declaration

-   -   (pluginURL: string, lazy: boolean): Promise<void\>
    -   Sets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text). Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left.
        
        #### Parameters
        
        -   pluginURL: string
            
            URL pointing to the Mapbox RTL text plugin source.
            
        -   lazy: boolean
            
            If set to `true`, maplibre will defer loading the plugin until rtl text is encountered, rtl text will then be rendered only after the plugin finishes loading.
            
        
        #### Returns Promise<void\>
        
        #### Example[](#example)
        
        ```typescript
        setRTLTextPlugin('https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.3.0/dist/mapbox-gl-rtl-text.js', false);
        ```
        
        #### See[](#see)
        
        -   [Add support for right-to-left scripts](https://maplibre.org/maplibre-gl-js/docs/examples/add-support-for-right-to-left-scripts/)
        -   [Display and style rich text labels](https://maplibre.org/maplibre-gl-js/docs/examples/display-and-style-rich-text-labels/)
