fun TextInputs()

in tooling/compose-intellij-platform/sample/plugin-1/src/main/kotlin/org/jetbrains/compose/intellij/platform/sample/TextInputs.kt [24:53]


fun TextInputs() {
    Column(
        modifier = Modifier.fillMaxWidth().padding(16.dp)
    ) {
        var name by remember { mutableStateOf(TextFieldValue("")) }
        var password by remember { mutableStateOf(TextFieldValue("")) }

        TextField(
            value = name,
            onValueChange = { newValue -> name = newValue },
            modifier = Modifier.padding(8.dp).fillMaxWidth(),
            textStyle = TextStyle(fontFamily = FontFamily.SansSerif),
            label = { Text("Account:") },
            placeholder = { Text("account name") }
        )

        OutlinedTextField(
            value = password,
            modifier = Modifier.padding(8.dp).fillMaxWidth(),
            label = { Text(text = "Password:") },
            placeholder = { Text(text = "your password") },
            textStyle = TextStyle(fontFamily = FontFamily.SansSerif),
            visualTransformation = PasswordVisualTransformation(),
            onValueChange = {
                password = it
            },
            keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password)
        )
    }
}