Start native apps faster with the Composables CLI ->
Object

SemanticsProperties

General semantics properties, mainly used for accessibility and testing.

Source set: Common
public object SemanticsProperties

General semantics properties, mainly used for accessibility and testing.

Each of these is intended to be set by the respective SemanticsPropertyReceiver extension instead of used directly. / /*@VisibleForTesting

Properties

ContentDescription

Source set: Common
public val ContentDescription: SemanticsPropertyKey<List<String>> =
        AccessibilityKey<List<String>>(
            name = "ContentDescription",
            mergePolicy = { parentValue, childValue ->
                parentValue?.toMutableList()?.also { it.addAll(childValue) } ?: childValue
            },
        )

StateDescription

Source set: Common
public val StateDescription: SemanticsPropertyKey<String> =
        AccessibilityKey<String>("StateDescription")

ProgressBarRangeInfo

Source set: Common
public val ProgressBarRangeInfo: SemanticsPropertyKey<ProgressBarRangeInfo> =
        AccessibilityKey<ProgressBarRangeInfo>("ProgressBarRangeInfo")

PaneTitle

Source set: Common
public val PaneTitle: SemanticsPropertyKey<String> =
        AccessibilityKey<String>(
            name = "PaneTitle",
            mergePolicy = { _, _ ->
                throw IllegalStateException(
                    "merge function called on unmergeable property PaneTitle."
                )
            },
        )

SelectableGroup

Source set: Common
public val SelectableGroup: SemanticsPropertyKey<Unit> =
        AccessibilityKey<Unit>("SelectableGroup")

CollectionInfo

Source set: Common
public val CollectionInfo: SemanticsPropertyKey<CollectionInfo> =
        AccessibilityKey<CollectionInfo>("CollectionInfo")

CollectionItemInfo

Source set: Common
public val CollectionItemInfo: SemanticsPropertyKey<CollectionItemInfo> =
        AccessibilityKey<CollectionItemInfo>("CollectionItemInfo")

Heading

Source set: Common
public val Heading: SemanticsPropertyKey<Unit> = AccessibilityKey<Unit>("Heading")

TextEntryKey

Source set: Common
public val TextEntryKey: SemanticsPropertyKey<Unit> = AccessibilityKey<Unit>("TextEntryKey")

Disabled

Source set: Common
public val Disabled: SemanticsPropertyKey<Unit> = AccessibilityKey<Unit>("Disabled")

LiveRegion

Source set: Common
public val LiveRegion: SemanticsPropertyKey<LiveRegionMode> =
        AccessibilityKey<LiveRegionMode>("LiveRegion")

Focused

Source set: Common
public val Focused: SemanticsPropertyKey<Boolean> = AccessibilityKey<Boolean>("Focused")

IsContainer

Source set: Common
@Deprecated("Use `isTraversalGroup` instead.", replaceWith = ReplaceWith("IsTraversalGroup"))
    // TODO(mnuzen): `isContainer` should not need to be an accessibility key after a new
    //  pruning API is added. See b/347038246 for more details.
    public val IsContainer: SemanticsPropertyKey<Boolean> = AccessibilityKey<Boolean>("IsContainer")

IsTraversalGroup

Source set: Common
public val IsTraversalGroup: SemanticsPropertyKey<Boolean> =
        SemanticsPropertyKey<Boolean>("IsTraversalGroup")

IsSensitiveData

Source set: Common
public val IsSensitiveData: SemanticsPropertyKey<Boolean> =
        SemanticsPropertyKey<Boolean>("IsSensitiveData")

InvisibleToUser

Source set: Common
@Deprecated(
        "Use `hideFromAccessibility` instead.",
        replaceWith = ReplaceWith("HideFromAccessibility"),
    )
    // Retain for binary compatibility with aosp/3341487 in 1.7
    public val InvisibleToUser: SemanticsPropertyKey<Unit> =
        SemanticsPropertyKey<Unit>(
            name = "InvisibleToUser",
            mergePolicy = { parentValue, _ -> parentValue },
        )

HideFromAccessibility

Source set: Common
public val HideFromAccessibility: SemanticsPropertyKey<Unit> =
        SemanticsPropertyKey<Unit>(
            name = "HideFromAccessibility",
            mergePolicy = { parentValue, _ -> parentValue },
        )

ContentType

Source set: Common
public val ContentType: SemanticsPropertyKey<ContentType> =
        SemanticsPropertyKey<ContentType>(
            name = "ContentType",
            mergePolicy = { parentValue, _ ->
                // Never merge autofill types
                parentValue
            },
        )

ContentDataType

Source set: Common
public val ContentDataType: SemanticsPropertyKey<ContentDataType> =
        SemanticsPropertyKey<ContentDataType>(
            name = "ContentDataType",
            mergePolicy = { parentValue, _ ->
                // Never merge autofill data types
                parentValue
            },
        )

FillableData

Source set: Common
public val FillableData: SemanticsPropertyKey<FillableData> =
        SemanticsPropertyKey<FillableData>(
            name = "FillableData",
            mergePolicy = { parentValue, _ ->
                // Never merge autofill types
                parentValue
            },
        )

TraversalIndex

Source set: Common
public val TraversalIndex: SemanticsPropertyKey<Float> =
        SemanticsPropertyKey<Float>(
            name = "TraversalIndex",
            mergePolicy = { parentValue, _ ->
                // Never merge traversal indices
                parentValue
            },
        )

HintText

Source set: Common
public val HintText: SemanticsPropertyKey<String> = AccessibilityKey<String>(name = "HintText")

HorizontalScrollAxisRange

Source set: Common
public val HorizontalScrollAxisRange: SemanticsPropertyKey<ScrollAxisRange> =
        AccessibilityKey<ScrollAxisRange>("HorizontalScrollAxisRange")

VerticalScrollAxisRange

Source set: Common
public val VerticalScrollAxisRange: SemanticsPropertyKey<ScrollAxisRange> =
        AccessibilityKey<ScrollAxisRange>("VerticalScrollAxisRange")

IsPopup

Source set: Common
public val IsPopup: SemanticsPropertyKey<Unit> =
        AccessibilityKey<Unit>(
            name = "IsPopup",
            mergePolicy = { _, _ ->
                throw IllegalStateException(
                    "merge function called on unmergeable property IsPopup. " +
                        "A popup should not be a child of a clickable/focusable node."
                )
            },
        )

IsDialog

Source set: Common
public val IsDialog: SemanticsPropertyKey<Unit> =
        AccessibilityKey<Unit>(
            name = "IsDialog",
            mergePolicy = { _, _ ->
                throw IllegalStateException(
                    "merge function called on unmergeable property IsDialog. " +
                        "A dialog should not be a child of a clickable/focusable node."
                )
            },
        )

Role

Source set: Common
public val Role: SemanticsPropertyKey<Role> =
        AccessibilityKey<Role>("Role") { parentValue, _ -> parentValue }

The type of user interface element. Accessibility services might use this to describe the element or do customizations. Most roles can be automatically resolved by the semantics properties of this element. But some elements with subtle differences need an exact role. If an exact role is not listed in Role, this property should not be set and the framework will automatically resolve it.

TestTag

Source set: Common
public val TestTag: SemanticsPropertyKey<String> =
        SemanticsPropertyKey<String>(
            name = "TestTag",
            isImportantForAccessibility = false,
            mergePolicy = { parentValue, _ ->
                // Never merge TestTags, to avoid leaking internal test tags to parents.
                parentValue
            },
        )

LinkTestMarker

Source set: Common
public val LinkTestMarker: SemanticsPropertyKey<Unit> =
        SemanticsPropertyKey<Unit>(
            name = "LinkTestMarker",
            isImportantForAccessibility = false,
            mergePolicy = { parentValue, _ -> parentValue },
        )

Marks a link within a text node (a link is represented by a androidx.compose.ui.text.LinkAnnotation) for identification during automated testing. This property is for internal use only and not intended for general use by developers.

Text

Source set: Common
public val Text: SemanticsPropertyKey<List<AnnotatedString>> =
        AccessibilityKey<List<AnnotatedString>>(
            name = "Text",
            mergePolicy = { parentValue, childValue ->
                parentValue?.toMutableList()?.also { it.addAll(childValue) } ?: childValue
            },
        )

TextSubstitution

Source set: Common
public val TextSubstitution: SemanticsPropertyKey<AnnotatedString> =
        SemanticsPropertyKey<AnnotatedString>(name = "TextSubstitution")

IsShowingTextSubstitution

Source set: Common
public val IsShowingTextSubstitution: SemanticsPropertyKey<Boolean> =
        SemanticsPropertyKey<Boolean>("IsShowingTextSubstitution")

InputText

Source set: Common
public val InputText: SemanticsPropertyKey<AnnotatedString> =
        AccessibilityKey<AnnotatedString>(name = "InputText")

EditableText

Source set: Common
public val EditableText: SemanticsPropertyKey<AnnotatedString> =
        AccessibilityKey<AnnotatedString>(name = "EditableText")

TextSelectionRange

Source set: Common
public val TextSelectionRange: SemanticsPropertyKey<TextRange> =
        AccessibilityKey<TextRange>("TextSelectionRange")

TextCompositionRange

Source set: Common
public val TextCompositionRange: SemanticsPropertyKey<TextRange?> =
        AccessibilityKey<TextRange?>("TextCompositionRange")

ImeAction

Source set: Common
public val ImeAction: SemanticsPropertyKey<ImeAction> = AccessibilityKey<ImeAction>("ImeAction")

Selected

Source set: Common
public val Selected: SemanticsPropertyKey<Boolean> = AccessibilityKey<Boolean>("Selected")

ToggleableState

Source set: Common
public val ToggleableState: SemanticsPropertyKey<ToggleableState> =
        AccessibilityKey<ToggleableState>("ToggleableState")

InputTextSuggestionState

Source set: Common
public val InputTextSuggestionState: SemanticsPropertyKey<InputTextSuggestionState> =
        AccessibilityKey<InputTextSuggestionState>("InputTextSuggestionState")

Password

Source set: Common
public val Password: SemanticsPropertyKey<Unit> = AccessibilityKey<Unit>("Password")

Error

Source set: Common
public val Error: SemanticsPropertyKey<String> = AccessibilityKey<String>("Error")

IndexForKey

Source set: Common
public val IndexForKey: SemanticsPropertyKey<(Any) -> Int> =
        SemanticsPropertyKey<(Any) -> Int>("IndexForKey")

IsEditable

Source set: Common
public val IsEditable: SemanticsPropertyKey<Boolean> =
        SemanticsPropertyKey<Boolean>("IsEditable")

MaxTextLength

Source set: Common
public val MaxTextLength: SemanticsPropertyKey<Int> = SemanticsPropertyKey<Int>("MaxTextLength")

Shape

Source set: Common
public val Shape: SemanticsPropertyKey<Shape> =
        SemanticsPropertyKey<Shape>(
            name = "Shape",
            isImportantForAccessibility = false,
            mergePolicy = { parentValue, _ ->
                // Never merge shapes
                parentValue
            },
        )