API
Node Types
Element
5 min
element objects are a type of node in a slate document that contain other element nodes or text nodes interface element { children node\[] } docid\ si09irnoskcrleagmslz9 docid\ si09irnoskcrleagmslz9 docid\ si09irnoskcrleagmslz9 docid\ si09irnoskcrleagmslz9 docid\ si09irnoskcrleagmslz9 docid\ si09irnoskcrleagmslz9 element behavior types element nodes behave differently depending on the docid\ wxgk44vnrmdbcbtb3n1ps 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
