nayan dhabarde
nayan dhabarde

Reputation: 2356

How to create multiline text area in jetpack compose

I want to create the following textfield. But there are no samples on the internet for the same, neither in material documentation enter image description here

Upvotes: 5

Views: 4191

Answers (1)

Mohammad Hanif Shaikh
Mohammad Hanif Shaikh

Reputation: 1501

  @Composable
    fun Textarea() {
    val text = rememberSaveable { mutableStateOf("") }
    TextField(
        value = text.value,
        onValueChange = { text.value = it }, modifier = Modifier
            .fillMaxWidth()
            .height(100.dp)
            .padding(10.dp)
            .border(width = 1.dp, color = Color.Black, shape = RoundedCornerShape(8.dp))
    )
}

You can change the size and customize it as you want as per your requirement.

Upvotes: 9

Related Questions