🌈 Create new beautiful Compose Gradients with our new wesite ->
Interface

TextFieldColors

Represents the colors of the input text, background and content (including label, placeholder, leading and trailing icons) used in a text field in different states.

Source set: Common
public interface TextFieldColors

Represents the colors of the input text, background and content (including label, placeholder, leading and trailing icons) used in a text field in different states.

See TextFieldDefaults.textFieldColors for the default colors used in TextField. See TextFieldDefaults.outlinedTextFieldColors for the default colors used in OutlinedTextField.

Functions

textColor

Source set: Common
@Composable public fun textColor(enabled: Boolean): State<Color>

Represents the color used for the input text of this text field.

Parameters

enabled whether the text field is enabled

backgroundColor

Source set: Common
@Composable public fun backgroundColor(enabled: Boolean): State<Color>

Represents the background color for this text field.

Parameters

enabled whether the text field is enabled

placeholderColor

Source set: Common
@Composable public fun placeholderColor(enabled: Boolean): State<Color>

Represents the color used for the placeholder of this text field.

Parameters

enabled whether the text field is enabled

labelColor

Source set: Common
@Composable
    public fun labelColor(
        enabled: Boolean,
        error: Boolean,
        interactionSource: InteractionSource,
    ): State<Color>

Represents the color used for the label of this text field.

Parameters

enabled whether the text field is enabled
error whether the text field should show error color according to the Material specifications. If the label is being used as a placeholder, this will be false even if the input is invalid, as the placeholder should not use the error color
interactionSource the InteractionSource of this text field. Helps to determine if the text field is in focus or not

leadingIconColor

Source set: Common
@Deprecated(
        message = "Use/implement overload with interactionSource parameter",
        replaceWith = ReplaceWith("leadingIconColor(enabled, isError, interactionSource)"),
        level = DeprecationLevel.WARNING,
    )
    @Composable
    public fun leadingIconColor(enabled: Boolean, isError: Boolean): State<Color>

Represents the color used for the leading icon of this text field.

Parameters

enabled whether the text field is enabled
isError whether the text field's current value is in error

leadingIconColor

Source set: Common
@Composable
    public fun leadingIconColor(
        enabled: Boolean,
        isError: Boolean,
        interactionSource: InteractionSource,
    ): State<Color>

Represents the color used for the leading icon of this text field.

Parameters

enabled whether the text field is enabled
isError whether the text field's current value is in error
interactionSource the InteractionSource of this text field. Helps to determine if the text field is in focus or not

trailingIconColor

Source set: Common
@Deprecated(
        message = "Use/implement overload with interactionSource parameter",
        replaceWith = ReplaceWith("trailingIconColor(enabled, isError, interactionSource)"),
        level = DeprecationLevel.WARNING,
    )
    @Composable
    public fun trailingIconColor(enabled: Boolean, isError: Boolean): State<Color>

Represents the color used for the trailing icon of this text field.

Parameters

enabled whether the text field is enabled
isError whether the text field's current value is in error

trailingIconColor

Source set: Common
@Composable
    public fun trailingIconColor(
        enabled: Boolean,
        isError: Boolean,
        interactionSource: InteractionSource,
    ): State<Color>

Represents the color used for the trailing icon of this text field.

Parameters

enabled whether the text field is enabled
isError whether the text field's current value is in error
interactionSource the InteractionSource of this text field. Helps to determine if the text field is in focus or not

indicatorColor

Source set: Common
@Composable
    public fun indicatorColor(
        enabled: Boolean,
        isError: Boolean,
        interactionSource: InteractionSource,
    ): State<Color>

Represents the color used for the border indicator of this text field.

Parameters

enabled whether the text field is enabled
isError whether the text field's current value is in error
interactionSource the InteractionSource of this text field. Helps to determine if the text field is in focus or not

cursorColor

Source set: Common
@Composable public fun cursorColor(isError: Boolean): State<Color>

Represents the color used for the cursor of this text field.

Parameters

isError whether the text field's current value is in error