---
title: "hintText"
description: "The hint text for an editable text field."
type: "property"
---
## API Reference

> Source set: Common

```kotlin
public var SemanticsPropertyReceiver.hintText: String by SemanticsProperties.HintText
```

The hint text for an editable text field. This is typically used to provide guidance to the user
about what to enter in the text field.

## Code Examples

### HintTextSample

```kotlin
@Sampled
@Composable
fun HintTextSample() {
    val label = "Label" // In an application, this hint would typically be a localized String.
    var text by remember { mutableStateOf("") }
    BasicTextField(
        value = text,
        onValueChange = { text = it },
        modifier = Modifier.semantics { hintText = label },
        decorationBox = { innerTextField ->
            Box {
                innerTextField()
                if (text.isEmpty()) {
                    // Hide this visual placeholder from talkback to prevent duplicated
                    // announcements, as the parent BasicTextField already provides the hintText.
                    Text(text = label, modifier = Modifier.semantics { hideFromAccessibility() })
                }
            }
        },
    )
}
```
