@ohos.arkui.node (Custom Node)

The Node module provides level-2 module APIs of custom nodes to export and use.

NOTE

  • The initial APIs of this module are supported since API version 11. Newly added APIs will be marked with a superscript to indicate their earliest API version.

  • The APIs of this module can be used only in the stage model.

  • Custom nodes are not available in DevEco Studio Previewer.

BuilderNode

The BuilderNode module provides APIs for creating a BuilderNode – a custom node that can be used to mount built-in components. Avoid mounting a BuilderNode as a child node to other custom nodes.

System capability: SystemCapability.ArkUI.ArkUI.Full

FrameNode

The FrameNode module provides APIs for a FrameNode, which represents an entity node in the component tree. It can be used by a NodeController to mount a BuilderNode (that holds the FrameNode) to a NodeContainer or mount a RenderNode to another FrameNode.

System capability: SystemCapability.ArkUI.ArkUI.Full

NodeController

The NodeController module provides APIs for managing custom nodes, such as creating, showing, and updating custom nodes, and APIs for mounting custom nodes to a NodeContainer component.

System capability: SystemCapability.ArkUI.ArkUI.Full

Graphics

Graphics module: provides APIs for defining attributes of a custom node.

System capability: SystemCapability.ArkUI.ArkUI.Full

RenderNode

The RenderNode module provides APIs for creating a RenderNode in custom drawing settings with C APIs.

System capability: SystemCapability.ArkUI.ArkUI.Full

XComponentNode

The XComponentNode module provides APIs a XComponentNode, an XComponent in the component tree. You can write EGL/OpenGL ES and media data and display it on the XComponent, whose rendering type can be dynamically modified.

System capability: SystemCapability.ArkUI.ArkUI.Full

Obtaining UI Context

To obtain the UI context, use any of the following methods:
1. Call getUIContext() in ohos.window to obtain the **UIContext **instance.

  1. Call the built-in method getUIContext() of the custom component.

  2. Use the makeNode callback of NodeController.