Nucleus
Input

Accessibility

Expose your Compose semantics to VoiceOver, Narrator, Orca and UI automation tools.

View as Markdown

Nucleus exposes your Compose semantics to VoiceOver on macOS, Narrator on Windows and Orca on Linux. You write standard Compose semantics and screen readers read them. Every DecoratedWindow comes with the bridge, part of nucleus-application.

Make your UI accessible

Attach Compose semantics to your composables. You never build accessibility nodes by hand:

Button(onClick = { count++ }, modifier = Modifier.testTag("increment")) {
    Text("Increment")
}

Image(
    painter = painterResource("logo.png"),
    contentDescription = "Company logo",
)

Text(
    "Loading",
    modifier = Modifier.semantics { contentDescription = "Loading, please wait" },
)

A screen reader sees the Button as a button it can activate and the Image as an image labeled "Company logo". Nodes marked InvisibleToUser or HideFromAccessibility stay out of the OS tree.

When a screen reader activates, increments or edits an element, Nucleus runs the matching Compose SemanticsActions handler on the UI thread. A read-only text field does not offer text editing to the screen reader.

Find elements from UI automation

Modifier.testTag(...) becomes a stable identifier that UI automation tools can query instead of the visible label:

PlatformAttribute
macOSAXIdentifier
WindowsUIA_AutomationIdPropertyId
LinuxAccessKit author id

What's next

Was this page helpful?
Edit on GitHub

Last updated on