Question Details

No question body available.

Tags

android kotlin android-jetpack-compose

Answers (1)

Accepted Answer Available
Accepted Answer
January 8, 2026 Score: 1 Rep: 1,011,348 Quality: High Completeness: 80%

If you are using the Compose Material3 version of TextField(), the placeholder parameter is a composable slot parameter, not a String. The same holds true if you are using the Compose Material version of TextField().

The documentation for Compose text fields demonstrates how to use placeholder, such as:

val usernameState = rememberTextFieldState() TextField( state = usernameState, lineLimits = TextFieldLineLimits.SingleLine, placeholder = { Text("Enter Username") } )