HarmonyOS (ArkUI)

harmony-arkui drives ArkUI through its NDK C node APIARKUI_NODE_BUTTON and friends — from a Rust cdylib, inside an ArkTS host project that hvigor packages into a .hap. It is Day’s newest backend, and this page says exactly where that shows.

Getting started

This is the least ergonomic toolchain 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 ohos subcommand wraps the emulator: creating, booting and connecting to the QEMU image without leaving the CLI.

Caveats and special considerations

This backend implements the widget vocabulary well and the surrounding platform integration partially. Concretely:

  • No dialogs. present() handles file open/save; alerts and prompts are ignored. If your UI depends on a confirmation dialog, it will silently do nothing here.
  • Most external pieces have no ArkUI arm — web view, media, map, Lottie, search field, combo box, activity indicator, remote image all render a placeholder. The date/time pickers and pull-to-refresh do have native arms.
  • 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 snugly as it does on other targets.
  • Much of the platform requires ArkTS, reached through the host project rather than the C API: navigation (Navigation/NavPathStack), file pickers, opening a URL, bundled resources, custom font registration, and app bootstrap. Day wires all of this for you in the scaffold — it is worth knowing 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

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 / 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
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

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 seam 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.