HarmonyOS (ArkUI)

Tier 3 · Experimental

harmony-arkui drives ArkUI through its NDK C node API (the ARKUI_NODE_* types) from a Rust cdylib, inside an ArkTS host project that hvigor packages into a .hap. It is Day’s newest backend (Tier 3 · Experimental), and this page lists where that shows.

Getting started

This toolchain takes the most setup steps of any Day supports. You need the OpenHarmony SDK plus the command-line tools (hvigor, hdc, the signing tools); day doctor --toolkit harmonyos checks each piece and prints setup help, and the HarmonyOS notes cover the install in detail.

cargo install day-cli
day new app my-app --toolkit harmony-arkui
cd my-app
day build -p harmony-arkui       # cross-compiles, then hvigor → signed .hap
day launch -p harmony-arkui      # installs and starts on an emulator or device

day build signs the .hap with the public development certificate, so you get an installable artifact without a vendor account. day pack -p harmony-arkui produces the release .hap, signed with your own material when configured.

The day devices boot command starts the emulator: day devices boot -p harmony-arkui (add --headless for CI) boots the Oniro QEMU image and connects hdc. It does not download images: point DAY_OHOS_EMULATOR at a directory holding the Oniro emulator images (default ~/ohos/emulator/images), or the command errors naming what is missing.

Caveats

The widget vocabulary is implemented; platform integration is partial:

  • present() handles file open/save; alerts and prompts are ignored. If your UI depends on a confirmation dialog, it will silently do nothing here.
  • Several external pieces have no ArkUI arm: media, map, Lottie, search field, combo box, activity indicator, and remote image all render a placeholder. The date/time pickers and pull-to-refresh have native arms, and the web view has an ArkTS arm: the crate ships its own ArkTS component, staged into the host project via [package.metadata.day.ohos], with load, back/forward, stop, and reload working.
  • All three picker styles collapse to one control: menu, segmented, and inline all become ARKUI_NODE_TEXT_PICKER.
  • Layout is measured for very few kinds. Labels, buttons and the text area ask ArkUI to measure; nearly everything else uses a fixed size, so unusual content may not fit as it does on other targets.
  • Much of the platform requires ArkTS, reached through the host project because the C API does not expose it: navigation (Navigation/NavPathStack), file pickers, opening a URL, bundled resources, custom font registration, and app bootstrap. Day wires all of this in the scaffold; you meet the ArkTS side when you go past what Day models.
  • Emulator behavior in CI is tolerated-flaky; the build and packaging steps gate hard.

What each piece becomes

The generated coverage matrix, checked in CI, covers every backend; this table adds links and notes.

Day calls the ArkUI native node API directly, so the mapping below is in terms of ArkUI_NodeType values. Where HarmonyOS’s NDK development guides cover a component, the node type links to that guide; the rest link to the OpenHarmony ArkUI_NodeType reference.

Day pieceArkUI node type
column / row / nav_stack / sectionARKUI_NODE_STACK
labelARKUI_NODE_TEXT
buttonARKUI_NODE_BUTTON
toggleARKUI_NODE_TOGGLE
sliderARKUI_NODE_SLIDER
text_fieldARKUI_NODE_TEXT_INPUT
text_areaARKUI_NODE_TEXT_AREA
picker() (all three styles)ARKUI_NODE_TEXT_PICKER
progress(f)ARKUI_NODE_PROGRESS
spinner()ARKUI_NODE_LOADING_PROGRESS
dividera 1 vp tinted ARKUI_NODE_STACK (no divider node type)
scrollARKUI_NODE_SCROLL
listARKUI_NODE_LIST with a node adapter (real recycling)
tabsARKUI_NODE_SWIPER
navARKUI_NODE_STACK, with pushed pages re-homed into ArkTS NavDestinations
nav_menua scroll + column of row nodes
cover()ARKUI_NODE_STACK re-homed onto the window root
imageARKUI_NODE_IMAGE
vectorARKUI_NODE_IMAGE rendering the staged SVG from rawfile day/ natively
canvasARKUI_NODE_CUSTOM drawn with OH_Drawing
external date_picker()ARKUI_NODE_DATE_PICKER inline, ARKUI_NODE_CALENDAR_PICKER compact
external time_picker()ARKUI_NODE_TIME_PICKER
external pull_refresh()ARKUI_NODE_REFRESH
external webview()the ArkTS Web component: the piece’s ArkTS, staged via [package.metadata.day.ohos] (the C node API has no Web node)

Further reading in the HarmonyOS NDK guides: using NDK APIs to build UIs (the index), NDK-based UI development overview, integrating with ArkTS pages (the ArkTS bridge Day’s scaffold wires), adding event responses, and building form components. The ArkUI_NodeType reference in the OpenHarmony documentation enumerates every node type, including the ones the guides don’t cover.