---
title: "unsetTextDirection command"
description: "Remove text direction attributes from nodes with the unsetTextDirection command. Learn more in our docs!"
canonical_url: "https://tiptap.dev/docs/editor/api/commands/nodes-and-marks/unset-text-direction"
---

# unsetTextDirection command

Remove text direction attributes from nodes with the unsetTextDirection command. Learn more in our docs!

The `unsetTextDirection` command removes the text direction attribute from nodes at the current selection or at a specified position. This allows nodes to inherit the direction from the editor's global `textDirection` setting or to have no direction attribute at all.

See also: [setTextDirection](https://tiptap.dev/docs/editor/api/commands/nodes-and-marks/set-text-direction.md)

## Parameters

### position

Optional. The position or range where the direction should be removed. If not provided, the command will use the current selection.

Can be:

- A number representing a specific position
- An object with `from` and `to` properties representing a range

## Examples

```js
// Remove direction from current selection
editor.commands.unsetTextDirection()

// Remove direction from a specific position
editor.commands.unsetTextDirection(5)

// Remove direction from a specific range
editor.commands.unsetTextDirection({ from: 0, to: 10 })

// Chain with other commands
editor.chain().focus().unsetTextDirection().run()
```
