Jetpack compose TextField (OutlinedTextField) Password

             val passwordState = remember { mutableStateOf(TextFieldValue()) }
                    var passwordVisibility: Boolean by remember { mutableStateOf(false) }

                    OutlinedTextField(
                        value = passwordState.value,
                        onValueChange = { passwordState.value = it
                    }, modifier = Modifier
                        .padding(top = 16.dp)
                        .fillMaxWidth(),

                        label = { Text("Password") },
                        placeholder = { Text(text = "Password")},

                        keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
                        colors = TextFieldDefaults.outlinedTextFieldColors(
                            focusedBorderColor = Purple500,
                            unfocusedBorderColor = Color.Black,
                            placeholderColor = Color.Gray,
                            textColor = Color.Black),
                        singleLine = true,
                        isError = true,
                        visualTransformation = if (passwordVisibility) VisualTransformation.None
                        else PasswordVisualTransformation(),
                        trailingIcon = {
                            val image = if (passwordVisibility)
                                Icons.Filled.Menu
                            else Icons.Filled.Menu

                            IconButton(onClick = {
                                passwordVisibility = !passwordVisibility
                            }) {
                                Icon(imageVector  = image, "")
                            }
                        }
                    )