androidx.compose.ui.autofill

contentTypeSince 1.9

Function · from org.jetbrains.compose.ui:ui:1.12.2

No hand-written docs yet.

Set autofill hint with contentType.

Parameters

fun Modifier.contentType(contentType: ContentType): Modifier

contentType: ContentTypeRequired

The ContentType to apply to the component's semantics.

Library docs

Set autofill hint with contentType.

This applies the contentType to the modifier's semantics, in turn enabling autofill and marking the hint to be associated with this composable. This allows autofill frameworks to provide relevant suggestions to users.

Using contentType is equivalent to simply setting the contentType semantic property, i.e. Modifier.contentType(ContentType.NewUsername) is equivalent to setting Modifier.semantics { contentType = ContentType.NewUsername }.