Text
import { Text } from 'slate'A text node in a Slate Document. Text nodes are always the bottom-most leaves in the document, just like in the DOM.
Properties
Text({
key: String,
})key
keyString
A unique identifier for the node.
object
objectString
An immutable string value of 'text' for easily separating this node from Inline or Block nodes.
Computed Properties
text
textString
A concatenated string of all of the characters in the text node.
Static Methods
Text.create
Text.createText.create(properties: Object) => Text
Create a text from a plain Javascript object of properties.
Text.fromJSON
Text.fromJSONText.fromJSON(object: Object) => Text
Create a text from a JSON object.
Text.isText
Text.isTextText.isText(maybeText: Any) => Boolean
Returns a boolean if the passed in argument is a Text.
Instance Methods
toJSON
toJSONtoJSON() => Object
Returns a JSON representation of the text.
Last updated
Was this helpful?