HarmonyOS ArkUI Text and Span Styling with Advanced Layout Controls
The textCase property enforces consistent capitalization of text content, regardless of the original string.
@Entry
@Component
struct TextCaseExample {
build() {
Column() {
Text("Original Text")
.textCase(TextCase.UpperCase)
.padding(10)
.border({ width: 1 })
Text("Original Text")
...
Posted on Tue, 23 Jun 2026 16:44:07 +0000 by solar_ninja
Styling and Implementing Buttons in HarmonyOS ArkUI
Creating a Circular Button
A circular button can be created by setting the ButtonType to Circle.
Button('Circle', { type: ButtonType.Normal, stateEffect: false })
.backgroundColor(0x317aff)
.width(90)
.height(90)
Note: The borderRadius property cannot be used to override the shape of a Circle type button.
Customizing Button Appearance
Va ...
Posted on Sat, 20 Jun 2026 16:52:25 +0000 by xsaero00
Text and Span Components in HarmonyOS ArkUI
In HarmonyOS ArkUI, the Text component serves as a container for displaying text content, while the Span component allows for styling specific portions of text within a Text container. The key distinction is that Text provides the overall container and layout properties, whereas Span enables granular text formatting within that container.
Text ...
Posted on Mon, 15 Jun 2026 17:57:03 +0000 by olidenia
Implementing Radio Buttons in HarmonyOS ArkUI
Handling Radio Button Events
In HarmonyOS ArkTS, the Radio component allows users to select one option from a group. Each radio button must share the same group value to ensure mutual exclusivity. Event handling is done via the .onChange() modifier.
// Example: Basic Radio Group with Logging
import router from '@ohos.router';
@Entry
@Component ...
Posted on Sun, 07 Jun 2026 17:31:14 +0000 by perry789
Building a Decoupled Custom Dialog System with ArkUI's Navigation.Dialog
Custom dialogs are essential in mobile application interfaces, covering modal, semi-modal, toast, and other overlay styles. A well-designed dialog component should be independent of specific UI pages and easily triggered from business logic.
Common real-world needs include:
Triggering dialogs from shared services (login prompts, full-screen ad ...
Posted on Wed, 03 Jun 2026 16:24:26 +0000 by sitorush
HarmonyOS ArkUI Event Handling: Mouse and Keyboard Events
Mouse Events
The onMouse event handler responds to various user interactions with the mouse interface. This callback function triggers when users perform mouse actions on the UI, enabling developers to capture and respond to mouse clicks, movements, scrolling, hovering, and other mouse-related operations.
The syntax for the onMouse event handle ...
Posted on Tue, 19 May 2026 06:32:44 +0000 by bdamod1
Advanced Interaction Patterns with Composite Gestures in ArkUI
ArkUI facilitates sophisticated user inputs by allowing developers to chain or merge basic touch primitives into composite actions. The primary mechanism is the GestureGroup constructor, which evaluates multiple gesture nodes simultaneously or sequentially based on a specified mode.
GestureGroup(mode: GestureMode, ...gestureNodes: GestureNode[] ...
Posted on Mon, 18 May 2026 06:03:59 +0000 by dark_destroyer
Handling Mouse and Keyboard Interactions in HarmonyOS ArkUI
HarmonyOS ArkUI provides a structured event system for capturing peripheral input. Effective UI development requires precise management of pointer tracking, visual feedback, and hardware keyboard interception.
Pointer Hover Detection
The onHover modifier monitors when a pointing device enters or exits a component's bounding box. It supplies a b ...
Posted on Sun, 17 May 2026 05:58:08 +0000 by spirp
Building Dynamic Lists in ArkUI for HarmonyOS
Axis ConfigurationBy default, the List component arranges its items vertically, automatically enabling vertical scrolling. To create a horizontally scrolling list, assign Axis.Horizontal to the listDirection property. The default value is Axis.Vertical.List() {
// ...
}
.listDirection(Axis.Horizontal)
Cross-Axis LayoutThe cross-axis layout is ...
Posted on Tue, 12 May 2026 14:55:02 +0000 by freeloader
Implementing Navigation and Tab Layout in HarmonyOS
Router Configuration
Add the router map reference in module.json5:
"routerMap": "$profile:route_map"
Route Map Definition
Create route_map.json in resources/base/profile/:
{
"routerMap": [
{
"name": "LaunchScreen",
"pageSourceFile": "src/main/ets/components/Laun ...
Posted on Sun, 10 May 2026 06:57:57 +0000 by silversinner