Unlabeled Actions in Custom Elements

Id UnlabeledActionsinCustomElements
Summary Custom clickable elements do not expose clear descriptions of their action
Severity Warning
Category Assistive Technologies / Dynamic Feedback
Affects Kotlin and Java files
Implementation Custom lint rule - check for usage of clickable elements (Modifier.clickable, Button, etc.) without an onClickLabel parameter.

Symptom

Interactive elements created with Jetpack Compose's Modifier.clickable lack the onClickLabel parameter, preventing assistive technologies from announcing the action associated with the element.

Rationale

Without an onClickLabel, assistive technology users may not know what action a clickable element will perform, making navigation and interaction unclear for those relying on screen readers.

Example

Kotlin Compose

@Composable
fun ExampleClickableText() {
    Text(
        text = "Show details",
        modifier = Modifier.clickable
        // Missing: onClickLabel = "Show more details"
    )
}

GitHub issues under this tag