---
url: /api/renderers/web-components/src/functions/getDir.md
---
[pantoken-root](../../../../index.md) / [renderers/web-components/src](../index.md) / getDir

# Function: getDir()

> **getDir**(`localeOrBundle`): `"ltr"` | `"rtl"`

Alpha

Return the text direction for a locale — using the [LOCALES](../variables/LOCALES.md) registry for known
locales, falling back to `"ltr"` for unknown tags.

## Parameters

### localeOrBundle

`string` | [`LocaleBundle`](../interfaces/LocaleBundle.md)

## Returns

`"ltr"` | `"rtl"`

## Example

```ts
getDir("ar"); // → "rtl"
getDir("hu"); // → "ltr"
```
