TextFieldColors

Known direct subclasses
TextFieldColorsWithIcons

This interface is deprecated. Empty interface; use parent TextFieldColors instead


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.

Summary

Public functions

State<Color>

Represents the background color for this text field.

Cmn
State<Color>

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

Cmn
State<Color>
@Composable
indicatorColor(
    enabled: Boolean,
    isError: Boolean,
    interactionSource: InteractionSource
)

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

Cmn
State<Color>
@Composable
labelColor(
    enabled: Boolean,
    error: Boolean,
    interactionSource: InteractionSource
)

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

Cmn
State<Color>

This function is deprecated. Use/implement overload with interactionSource parameter

Cmn
open State<Color>
@Composable
leadingIconColor(
    enabled: Boolean,
    isError: Boolean,
    interactionSource: InteractionSource
)

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

Cmn
State<Color>

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

Cmn
State<Color>

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

Cmn
State<Color>

This function is deprecated. Use/implement overload with interactionSource parameter

Cmn
open State<Color>
@Composable
trailingIconColor(
    enabled: Boolean,
    isError: Boolean,
    interactionSource: InteractionSource
)

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

Cmn

Public functions

backgroundColor

@Composable
fun backgroundColor(enabled: Boolean): State<Color>

Represents the background color for this text field.

Parameters
enabled: Boolean

whether the text field is enabled

cursorColor

@Composable
fun cursorColor(isError: Boolean): State<Color>

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

Parameters
isError: Boolean

whether the text field's current value is in error

indicatorColor

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

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

Parameters
enabled: Boolean

whether the text field is enabled

isError: Boolean

whether the text field's current value is in error

interactionSource: InteractionSource

the InteractionSource of this text field. Helps to determine if the text field is in focus or not

labelColor

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

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

Parameters
enabled: Boolean

whether the text field is enabled

error: Boolean

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: InteractionSource

the InteractionSource of this text field. Helps to determine if the text field is in focus or not

leadingIconColor

@Composable
fun leadingIconColor(enabled: Boolean, isError: Boolean): State<Color>

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

Parameters
enabled: Boolean

whether the text field is enabled

isError: Boolean

whether the text field's current value is in error

leadingIconColor

@Composable
open fun leadingIconColor(
    enabled: Boolean,
    isError: Boolean,
    interactionSource: InteractionSource
): State<Color>

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

Parameters
enabled: Boolean

whether the text field is enabled

isError: Boolean

whether the text field's current value is in error

interactionSource: InteractionSource

the InteractionSource of this text field. Helps to determine if the text field is in focus or not

placeholderColor

@Composable
fun placeholderColor(enabled: Boolean): State<Color>

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

Parameters
enabled: Boolean

whether the text field is enabled

textColor

@Composable
fun textColor(enabled: Boolean): State<Color>

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

Parameters
enabled: Boolean

whether the text field is enabled

trailingIconColor

@Composable
fun trailingIconColor(enabled: Boolean, isError: Boolean): State<Color>

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

Parameters
enabled: Boolean

whether the text field is enabled

isError: Boolean

whether the text field's current value is in error

trailingIconColor

@Composable
open fun trailingIconColor(
    enabled: Boolean,
    isError: Boolean,
    interactionSource: InteractionSource
): State<Color>

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

Parameters
enabled: Boolean

whether the text field is enabled

isError: Boolean

whether the text field's current value is in error

interactionSource: InteractionSource

the InteractionSource of this text field. Helps to determine if the text field is in focus or not