TextInput
fun InputGroupScope.TextInput(text: String, onTextChange: (String) -> Unit, modifier: Modifier = Modifier, variant: CssStyleVariant<InputKind>? = InputDefaults.Variant, placeholder: String? = null, placeholderColor: PlaceholderColor? = null, focusBorderColor: CSSColorValue? = null, invalidBorderColor: CSSColorValue? = null, password: Boolean = false, enabled: Boolean = InputDefaults.Enabled, valid: Boolean = InputDefaults.Valid, required: Boolean = InputDefaults.Required, readOnly: Boolean = InputDefaults.ReadOnly, spellCheck: Boolean = InputDefaults.SpellCheck, autoComplete: AutoComplete? = null, onCommit: () -> Unit = {}, ref: ElementRefScope<HTMLInputElement>? = null)(source)
@Composable
Like Input but for the common case of dealing with text.
By default, acts like Input(InputType.Text)
unless password
is set to true, in which case it acts like Input(InputType.Password)
.
A simple example looks like this:
var text by remember { mutableStateOf("") }
TextInput(text, onTextChange = { text = it })
Content copied to clipboard
See Input
for an explanation of all the parameters.