mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-24 09:13:24 +01:00
* replace block api refs with inline * fix inline link refs in static method sections * link fixes in few more files
64 lines
1.2 KiB
Markdown
64 lines
1.2 KiB
Markdown
|
|
# `Text`
|
|
|
|
```js
|
|
import { Text } from 'slate'
|
|
```
|
|
|
|
A text node in a Slate [`Document`](./document.md). Text nodes are always the bottom-most leaves in the document, just like in the DOM.
|
|
|
|
- [Properties](#properties)
|
|
- [`characters`](#characters)
|
|
- [`key`](#key)
|
|
- [Computed Properties](#computed-properties)
|
|
- [`kind`](#kind)
|
|
- [`length`](#length)
|
|
- [`text`](#text)
|
|
- [Static Methods](#static-methods)
|
|
- [`Text.create`](#textcreate)
|
|
|
|
|
|
## Properties
|
|
|
|
```js
|
|
Text({
|
|
characters: Immutable.List<Character>,
|
|
key: String
|
|
})
|
|
```
|
|
|
|
### `characters`
|
|
|
|
A list of [`Characters`](./character.md) with associated [`Marks`](./mark.md) that make up the text node's content.
|
|
|
|
### `key`
|
|
`String`
|
|
|
|
A unique identifier for the node.
|
|
|
|
|
|
## Computed Properties
|
|
|
|
### `kind`
|
|
`String`
|
|
|
|
An immutable string value of `'text'` for easily separating this node from [`Inline`](./inline.md) or [`Block`](./block.md) nodes.
|
|
|
|
### `length`
|
|
`Number`
|
|
|
|
The length of all of the characters in the text node.
|
|
|
|
### `text`
|
|
`String`
|
|
|
|
A concatenated string of all of the characters in the text node.
|
|
|
|
|
|
## Static Methods
|
|
|
|
### `Text.create`
|
|
`Text.create(properties: Object) => Text`
|
|
|
|
Create a text from a plain Javascript object of `properties`.
|