# Directionality

> Editor42 Directionality plugin: toolbar buttons that set the text direction of a block to left-to-right or right-to-left, and of a whole list from any item.

Source: https://editor42.com/plugins/directionality  
Every page of editor42.com has a Markdown copy at its URL + `.md` (`index.md` after a URL that ends in `/`); all of them are in one file: https://editor42.com/llms-full.txt

Plugin alias: `directionality`

```js
editor42.init({
  plugins: 'directionality'
});
```

Adds controls to set the text direction of block-level elements to either left-to-right (LTR) or right-to-left (RTL). Handles list items specially by applying direction to the parent list element. Uses both the `dir` HTML attribute and inline CSS `direction` style as a fallback.

## Commands

| Command | Description |
|---|---|
| `editor42DirectionLTR` | Sets direction to LTR. |
| `editor42DirectionRTL` | Sets direction to RTL. |

## Toolbar buttons

| Name | Type | Description |
|---|---|---|
| `ltr` | Toggle button | Active when current block direction is LTR. |
| `rtl` | Toggle button | Active when current block direction is RTL. |
