# Text

```javascript
import { Text } from 'slate'
```

A text node in a Slate [`Document`](https://docs.slatejs.org/v0.47/slate-core/document). Text nodes are always the bottom-most leaves in the document, just like in the DOM.

## Properties

```javascript
Text({
  key: String,
  text: String,
  marks: Immutable.List<Mark>,
})
```

### `key`

`String`

A unique identifier for the node.

### `text`

`String`

The text contents of this node.

### `marks`

`Immutable.Set<Mark>,`

A list of marks for this node.

### `object`

`String`

An immutable string value of `'text'` for easily separating this node from [`Inline`](https://docs.slatejs.org/v0.47/slate-core/inline) or [`Block`](https://docs.slatejs.org/v0.47/slate-core/block) nodes.

## Static Methods

### `Text.create`

`Text.create(properties: Object) => Text`

Create a text from a plain JavaScript object of `properties`.

### `Text.fromJSON`

`Text.fromJSON(object: Object) => Text`

Create a text from a JSON `object`.

### `Text.isText`

`Text.isText(maybeText: Any) => Boolean`

Returns a boolean if the passed in argument is a `Text`.

## Instance Methods

### `toJSON`

`toJSON() => Object`

Returns a JSON representation of the text.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.slatejs.org/v0.47/slate-core/text.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
