Text Field
A TextField component with COUI style.
Parameters
The TextFieldState to be shown in the text field.
The modifier to be applied to the TextField.
The TextFieldMode of the background decoration. Defaults to TextFieldMode.Line, the form ColorOS Settings uses for dialog / panel inputs.
The margin inside the TextField. Defaults to the COUI padding of the selected backgroundMode.
The TextFieldColors applied to the TextField. Use TextFieldDefaults.textFieldColors to customize.
The corner radius of the TextField (only used by TextFieldMode.Rectangle).
The label (hint) to be displayed when the TextField is empty.
Whether the label behaves as a plain placeholder that disappears once text is entered (COUI default). Set to false to enable the COUI HintAnim floating-label animation.
Only used by TextFieldMode.Line: hide the resting underline and show just the focused expanding line, mirroring COUIInputPreference couiJustShowFocusLine.
Whether the TextField is enabled.
Whether the TextField is read-only.
Whether the TextField is in error state. Turning this on tints the border / underline and label with TextFieldColors.errorColor and plays a horizontal shake animation, mirroring COUIErrorEditTextHelper.
The maximum number of characters. When not null a "count/max" counter is shown at the end and input is truncated at maxCount, mirroring COUIInputView couiInputMaxCount.
Whether to show a clear (fast delete) button when the TextField is focused and not empty, mirroring COUIEditText quickDelete.
Whether to show an eye toggle that switches the password visibility, mirroring COUIInputView couiEnablePassword. While the password is hidden, the text is masked and outputTransformation is ignored.
The input transformation to be applied to the TextField.
The text style to be applied to the TextField. Defaults to the COUI input text of the selected backgroundMode: 16sp regular (couiEditTextTextAppearance), bold in TextFieldMode.Rectangle (Widget.COUI.EditText.HintAnim.Rectangle android:textStyle=bold).
The keyboard options to be applied to the TextField.
The keyboard action handler for the TextField.
The line limits for the TextField.
The leading icon to be displayed in the TextField.
The trailing icon to be displayed in the TextField.
The callback to be called when the text layout changes.
The interaction source to be applied to the TextField.
The brush to be used for the cursor.
The output transformation for the text field.
The scroll state for the text field.
A TextField component with COUI style.
Parameters
The input TextFieldValue to be shown in the text field.
The callback that is triggered when the input service updates values in TextFieldValue. An updated TextFieldValue comes as a parameter of the callback.
The modifier to be applied to the TextField.
The TextFieldMode of the background decoration. Defaults to TextFieldMode.Line, the form ColorOS Settings uses for dialog / panel inputs.
The margin inside the TextField. Defaults to the COUI padding of the selected backgroundMode.
The TextFieldColors applied to the TextField. Use TextFieldDefaults.textFieldColors to customize.
The corner radius of the TextField (only used by TextFieldMode.Rectangle).
The label (hint) to be displayed when the TextField is empty.
Whether the label behaves as a plain placeholder that disappears once text is entered (COUI default). Set to false to enable the COUI HintAnim floating-label animation.
Only used by TextFieldMode.Line: hide the resting underline and show just the focused expanding line, mirroring COUIInputPreference couiJustShowFocusLine.
Whether the TextField is enabled.
Whether the TextField is read-only.
Whether the TextField is in error state. Turning this on tints the border / underline and label with TextFieldColors.errorColor and plays a horizontal shake animation, mirroring COUIErrorEditTextHelper.
The maximum number of characters. When not null a "count/max" counter is shown at the end and input is truncated at maxCount, mirroring COUIInputView couiInputMaxCount.
Whether to show a clear (fast delete) button when the TextField is focused and not empty, mirroring COUIEditText quickDelete.
Whether to show an eye toggle that switches the password visibility, mirroring COUIInputView couiEnablePassword. While the password is hidden, the text is masked and visualTransformation is ignored.
The text style to be applied to the TextField. Defaults to the COUI input text of the selected backgroundMode.
The keyboard options to be applied to the TextField.
The keyboard actions to be applied to the TextField.
The leading icon to be displayed in the TextField.
The trailing icon to be displayed in the TextField.
Whether the text field is single line.
The maximum number of lines allowed to be displayed in TextField.
The visual transformation to be applied to the TextField.
The callback to be called when the text layout changes.
The interaction source to be applied to the TextField.
The brush to be used for the cursor.
A text field component with COUI style.
Parameters
The text to be displayed in the text field.
The callback to be called when the value changes.
The modifier to be applied to the TextField.
The TextFieldMode of the background decoration. Defaults to TextFieldMode.Line, the form ColorOS Settings uses for dialog / panel inputs.
The margin inside the TextField. Defaults to the COUI padding of the selected backgroundMode.
The TextFieldColors applied to the TextField. Use TextFieldDefaults.textFieldColors to customize.
The corner radius of the TextField (only used by TextFieldMode.Rectangle).
The label (hint) to be displayed when the TextField is empty.
Whether the label behaves as a plain placeholder that disappears once text is entered (COUI default). Set to false to enable the COUI HintAnim floating-label animation.
Only used by TextFieldMode.Line: hide the resting underline and show just the focused expanding line, mirroring COUIInputPreference couiJustShowFocusLine.
Whether the TextField is enabled.
Whether the TextField is read-only.
Whether the TextField is in error state. Turning this on tints the border / underline and label with TextFieldColors.errorColor and plays a horizontal shake animation, mirroring COUIErrorEditTextHelper.
The maximum number of characters. When not null a "count/max" counter is shown at the end and input is truncated at maxCount, mirroring COUIInputView couiInputMaxCount.
Whether to show a clear (fast delete) button when the TextField is focused and not empty, mirroring COUIEditText quickDelete.
Whether to show an eye toggle that switches the password visibility, mirroring COUIInputView couiEnablePassword. While the password is hidden, the text is masked and visualTransformation is ignored.
The text style to be applied to the TextField. Defaults to the COUI input text of the selected backgroundMode.
The keyboard options to be applied to the TextField.
The keyboard actions to be applied to the TextField.
The leading icon to be displayed in the TextField.
The trailing icon to be displayed in the TextField.
Whether the text field is single line.
The maximum number of lines allowed to be displayed in TextField.
The visual transformation to be applied to the TextField.
The callback to be called when the text layout changes.
The interaction source to be applied to the TextField.
The brush to be used for the cursor.