{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "api-slate-element-docs",
  "title": "Element",
  "description": "API reference for elements in Slate.",
  "files": [
    {
      "path": "../../content/docs/api/slate/element.mdx",
      "content": "---\ntitle: Element\ndescription: API reference for elements in Slate.\n---\n\n`TElement` objects are a type of `Node` in a Plate document that contain other `TElement` nodes or `Text` nodes.\n\n```typescript\ninterface TElement {\n  children: Descendant[]\n  type: string\n  [key: string]: unknown\n}\n```\n\n## Element Behavior\n\nElements can have different behaviors depending on the editor's configuration:\n\n### Block vs Inline\n\nElements can be either \"block\" or \"inline\" as defined by plugin `node.isInline`:\n\n- Block elements can only be siblings with other block elements\n- Inline elements can be siblings with Text nodes or other inline elements\n\n### Void vs Non-void\n\nElements can be either \"void\" or \"non-void\" as defined by plugin `node.isVoid`:\n\n- Non-void elements: Slate handles rendering of children (e.g., paragraph with Text and Inline children)\n- Void elements: Children are rendered by the Element's render code\n\n### Markable Voids\n\nSome void elements can support marks through plugin `node.markableVoid`. For example, a mention element might need to support bold or italic formatting.\n\n## `ElementAPI`\n\n### `isElementType`\n\nCheck if a value implements the `TElement` interface and has `elementKey` matching a specified value. Defaults to checking the `'type'` key.\n\n<API name=\"isElementType\">\n<APIParameters>\n  <APIItem name=\"value\" type=\"any\">\n    The value to check.\n  </APIItem>\n  <APIItem name=\"elementVal\" type=\"string\">\n    The value to match against.\n  </APIItem>\n  <APIItem name=\"elementKey\" type=\"string\" optional>\n    The key to check. Defaults to `'type'`.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  `true` if the value is an element with the specified key matching `elementVal`.\n</APIReturns>\n</API>\n\n### `isAncestor`\n\nCheck if a value implements the `Ancestor` interface.\n\n<API name=\"isAncestor\">\n<APIParameters>\n  <APIItem name=\"value\" type=\"any\">\n    The value to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  `true` if the value is an ancestor node.\n</APIReturns>\n</API>\n\n### `isElement`\n\nCheck if a value implements the `TElement` interface.\n\n<API name=\"isElement\">\n<APIParameters>\n  <APIItem name=\"value\" type=\"any\">\n    The value to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  `true` if the value is a Plate element.\n</APIReturns>\n</API>\n\n### `isElementList`\n\nCheck if a value is an array of `TElement` objects.\n\n<API name=\"isElementList\">\n<APIParameters>\n  <APIItem name=\"value\" type=\"any\">\n    The value to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  `true` if the value is an array of elements.\n</APIReturns>\n</API>\n\n### `isElementProps`\n\nCheck if a set of props is a partial of `TElement`.\n\n<API name=\"isElementProps\">\n<APIParameters>\n  <APIItem name=\"props\" type=\"any\">\n    The props to check.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  `true` if the props match element properties.\n</APIReturns>\n</API>\n\n### `matches`\n\nCheck if an element matches a set of properties.\n\n<API name=\"matches\">\n<APIParameters>\n  <APIItem name=\"element\" type=\"TElement\">\n    The element to check.\n  </APIItem>\n  <APIItem name=\"props\" type=\"Partial<TElement>\">\n    The properties to match against.\n  </APIItem>\n</APIParameters>\n\n<APIReturns type=\"boolean\">\n  `true` if the element matches all provided properties.\n</APIReturns>\n</API>\n\n## Types\n\n### `TElement`\n\n`TElement` objects are a type of node in a Plate document that contain other element nodes or text nodes. They can be either \"blocks\" or \"inlines\" depending on the editor's configuration.\n\n`Element` is a type alias for `TElement`.\n\n<API name=\"TElement\">\n<APIAttributes>\n  <APIItem name=\"children\" type=\"Descendant[]\">\n    An array of child nodes that can be either elements or text nodes.\n  </APIItem>\n  <APIItem name=\"type\" type=\"string\">\n    A string identifier that defines the element's type (e.g., 'paragraph', 'heading', etc.).\n  </APIItem>\n</APIAttributes>\n</API>\n\n### `ElementEntry`\n\nElement entries represent an Element node and its path.\n\n<API name=\"ElementEntry\">\n<APIAttributes>\n  <APIItem name=\"0\" type=\"Element\">\n    The Element node.\n  </APIItem>\n  <APIItem name=\"1\" type=\"Path\">\n    The path to the element.\n  </APIItem>\n</APIAttributes>\n</API>\n\n### `ElementOrTextOf`\n\n```ts\ntype ElementOrTextOf<E extends Editor> = ElementOf<E> | TextOf<E>;\n```\n\nThe `ElementOrTextOf` type represents either an element or a text node from a specific editor type.\n\n### `ElementOrTextIn`\n\n```ts\ntype ElementOrTextIn<V extends Value> = ElementIn<V> | TextIn<V>;\n```\n\nThe `ElementOrTextIn` type represents either an element or a text node from a specific value type.\n\n### `ElementOf`\n\n`ElementOf` is a utility type to get all the element node types from a given root node type.\n\n### `ElementIn`\n\n```ts\ntype ElementIn<V extends Value> = ElementOf<V[number]>;\n```\n\n`ElementIn` is a utility type to get an element type from a Plate `Value` type.\n```",
      "type": "registry:file",
      "target": "content/docs/plate/api/slate/element.mdx"
    }
  ],
  "type": "registry:file"
}