In the decorationBox
parameter you can add a TextFieldDefaults.OutlinedTextFieldDecorationBox
where you can define the placeholder
.
Something like:
var enabled by remember { mutableStateOf(true) }
val interactionSource = remember { MutableInteractionSource() }
BasicTextField(
value = text,
onValueChange = { text = it },
singleLine = singleLine,
interactionSource = interactionSource,
decorationBox = @Composable { innerTextField ->
TextFieldDefaults.OutlinedTextFieldDecorationBox(
value = text,
innerTextField = innerTextField,
enabled = enabled,
singleLine = singleLine,
visualTransformation = VisualTransformation.None,
interactionSource = interactionSource,
placeholder = { Text("placeholder") }
)
}
)