MCPcopy Create free account
hub / github.com/Compose-for-OpenHarmony/HarmonyDom

github.com/Compose-for-OpenHarmony/HarmonyDom @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
111 symbols 236 edges 15 files 0 documented · 0% updated 2y ago★ 32

Browse by type

Functions 82 Types & classes 29
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Harmony Dom


Harmony Dom

Harmony Dom is a dom api for OpenHarmony Components.

Install

{
  // ...
  "dependencies": {
    "oh_compose/harmony_dom": "0.1.6"
  }
}

Sample Code

import { BaseNode, ButtonNode, ColumnNode, createNode, TextNode } from '@oh_compose/harmony_dom';

@Entry
@Component
struct Index {

  createDomNode(): BaseNode {
    let rootNode = new ColumnNode()

    let text = new TextNode()
    text.setText("0")

    let button = new ButtonNode()
    button.setText("Add")
    button.onClick(() => {
      let currentCount = Number.parseInt(text.text)
      text.setText(`${currentCount + 1}`)
    })

    rootNode.insert(0, button)
    rootNode.insert(1, text)

    return rootNode
  }

  build() {
    Stack() {
      createUIFromNode(this.createDomNode())
    }
  }
}

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 45
Method 37
Class 28
Enum 1

Languages

TypeScript100%

Modules by API surface

hvigor/hvigor-wrapper.js58 symbols
harmony_dom/src/main/ets/dom/text/TextNode.ts12 symbols
harmony_dom/src/main/ets/dom/base/BaseNode.ts11 symbols
harmony_dom/src/main/ets/dom/base/BaseNodeGroup.ts10 symbols
harmony_dom/src/main/ets/dom/image/ImageNode.ts4 symbols
harmony_dom/src/main/ets/dom/button/ButtonNode.ts4 symbols
harmony_dom/src/main/ets/dom/divider/DividerNode.ts3 symbols
harmony_dom/src/main/ets/dom/FrameCallback.ts3 symbols
harmony_dom/src/main/ets/dom/row/RowNode.ts2 symbols
harmony_dom/src/main/ets/dom/list/ListNode.ts2 symbols
harmony_dom/src/main/ets/dom/column/ColumnNode.ts2 symbols

For agents

$ claude mcp add HarmonyDom \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page