API
Node Types

Element

6min
element objects are a type of node in a slate document that contain other element nodes or text nodes interface element { children node\[] } element docid\ uy l6aaboditd94nbs48belement docid\ uy l6aaboditd94nbs48belement docid\ uy l6aaboditd94nbs48belement docid\ uy l6aaboditd94nbs48belement docid\ uy l6aaboditd94nbs48belement docid\ uy l6aaboditd94nbs48b element behavior types element nodes behave differently depending on the editor docid\ ww8vm2pch cv szwtnx2f an element can be "block" or "inline" as defined by editor isinline either "void" or "not void" as defined by editor isvoid block vs inline a "block" element can only be siblings with other "block" elements an "inline" node can be siblings with text nodes or other "inline" elements void vs not void in a not "void" element, slate handles the rendering of its children (e g in a paragraph where the text and inline children are rendered by slate) in a "void" element, the children are rendered by the element 's render code static methods retrieval methods element matches(element element, props partial\<element>) => boolean check if an element matches a set of props note this checks custom properties, but it does not ensure that any children are equivalent check methods element iselement(value any) => value is element check if a value implements the element interface element iselementlist(value any) => value is element\[] check if a value is an array of element objects
🤔
Have a question?
Our super-smart AI,knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.