TextFieldDefaults
-
Cmn
object TextFieldDefaults
Contains the default values used by TextField. For defaults used in OutlinedTextField, see OutlinedTextFieldDefaults.
Summary
Public functions |
||
|---|---|---|
Unit |
@ComposableComposable that draws a default container for a |
Cmn
|
Unit |
@ExperimentalMaterial3ApiThis function is deprecated. Renamed to TextFieldDefaults.Container |
Cmn
|
Unit |
@ComposableA decoration box used to create custom text fields based on Material Design filled text field. |
Cmn
|
TextFieldColors |
Creates a |
Cmn
|
TextFieldColors |
@ComposableCreates a |
Cmn
|
PaddingValues |
contentPaddingWithLabel(start: Dp, end: Dp, top: Dp, bottom: Dp)Default content padding of the input field within the |
Cmn
|
PaddingValues |
contentPaddingWithoutLabel(start: Dp, top: Dp, end: Dp, bottom: Dp)Default content padding of the input field within the |
Cmn
|
TextFieldDecorator |
@ComposableA decorator used to create custom text fields based on Material Design filled text field. |
Cmn
|
Modifier |
Modifier.indicatorLine(A modifier to draw a default bottom indicator line for |
Cmn
|
PaddingValues |
This function is deprecated. Renamed to `OutlinedTextFieldDefaults.contentPadding` |
Cmn
|
PaddingValues |
This function is deprecated. Renamed to `TextFieldDefaults.contentPaddingWithLabel` |
Cmn
|
PaddingValues |
This function is deprecated. Renamed to `TextFieldDefaults.contentPaddingWithoutLabel` |
Cmn
|
Public properties |
||
|---|---|---|
Dp |
This property is deprecated. Split into `TextFieldDefaults.FocusedIndicatorThickness` and `OutlinedTextFieldDefaults.FocusedBorderThickness`. |
Cmn
|
Dp |
The default thickness of the indicator line in |
Cmn
|
Dp |
The default min height applied to a |
Cmn
|
Dp |
The default min width applied to a |
Cmn
|
Dp |
This property is deprecated. Split into `TextFieldDefaults.UnfocusedIndicatorThickness` and `OutlinedTextFieldDefaults.UnfocusedBorderThickness`. |
Cmn
|
Dp |
The default thickness of the indicator line in |
Cmn
|
Shape |
This property is deprecated. Renamed to `TextFieldDefaults.shape` |
Cmn
|
Shape |
This property is deprecated. Renamed to `OutlinedTextFieldDefaults.shape` |
Cmn
|
Shape |
Default shape for a |
Cmn
|
Public functions
Container
@Composable
fun Container(
enabled: Boolean,
isError: Boolean,
interactionSource: InteractionSource,
modifier: Modifier = Modifier,
colors: TextFieldColors = colors(),
shape: Shape = TextFieldDefaults.shape,
focusedIndicatorLineThickness: Dp = FocusedIndicatorThickness,
unfocusedIndicatorLineThickness: Dp = UnfocusedIndicatorThickness
): Unit
Composable that draws a default container for a TextField with an indicator line at the bottom. You can apply it to a BasicTextField using decorator or DecorationBox to create a custom text field based on the styling of a Material filled text field. The TextField component applies it automatically.
| Parameters | |
|---|---|
enabled: Boolean |
whether the text field is enabled |
isError: Boolean |
whether the text field's current value is in error |
interactionSource: InteractionSource |
the |
modifier: Modifier = Modifier |
the |
colors: TextFieldColors = colors() |
|
shape: Shape = TextFieldDefaults.shape |
the shape of this container |
focusedIndicatorLineThickness: Dp = FocusedIndicatorThickness |
thickness of the indicator line when the text field is focused |
unfocusedIndicatorLineThickness: Dp = UnfocusedIndicatorThickness |
thickness of the indicator line when the text field is not focused |
ContainerBox
@ExperimentalMaterial3Api
@Composable
funContainerBox(
enabled: Boolean,
isError: Boolean,
interactionSource: InteractionSource,
colors: TextFieldColors,
shape: Shape = TextFieldDefaults.shape
): Unit
DecorationBox
@Composable
fun DecorationBox(
value: String,
innerTextField: @Composable () -> Unit,
enabled: Boolean,
singleLine: Boolean,
visualTransformation: VisualTransformation,
interactionSource: InteractionSource,
isError: Boolean = false,
label: (@Composable () -> Unit)? = null,
placeholder: (@Composable () -> Unit)? = null,
leadingIcon: (@Composable () -> Unit)? = null,
trailingIcon: (@Composable () -> Unit)? = null,
prefix: (@Composable () -> Unit)? = null,
suffix: (@Composable () -> Unit)? = null,
supportingText: (@Composable () -> Unit)? = null,
shape: Shape = TextFieldDefaults.shape,
colors: TextFieldColors = colors(),
contentPadding: PaddingValues = if (label == null) { contentPaddingWithoutLabel() } else { contentPaddingWithLabel() },
container: @Composable () -> Unit = { Container( enabled = enabled, isError = isError, interactionSource = interactionSource, modifier = Modifier, colors = colors, shape = shape, focusedIndicatorLineThickness = FocusedIndicatorThickness, unfocusedIndicatorLineThickness = UnfocusedIndicatorThickness, ) }
): Unit
A decoration box used to create custom text fields based on Material Design filled text field.
If your text field requires customising elements that aren't exposed by TextField, consider using this decoration box to achieve the desired design.
For example, if you wish to customise the bottom indicator line, you can pass a custom Container to this decoration box's container.
This decoration box is meant to be used in conjunction with overloads of BasicTextField that accept a decorationBox parameter. For other overloads of BasicTextField that use a TextFieldDecorator, see decorator.
An example of building a custom text field using DecorationBox:
import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.collectIsFocusedAsState import androidx.compose.foundation.text.BasicTextField import androidx.compose.material3.LocalTextStyle import androidx.compose.material3.Text import androidx.compose.material3.TextField import androidx.compose.material3.TextFieldDefaults import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.graphics.takeOrElse import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.input.VisualTransformation import androidx.compose.ui.unit.dp var text by remember { mutableStateOf("") } val interactionSource = remember { MutableInteractionSource() } val customColors = TextFieldDefaults.colors( focusedTextColor = Color.DarkGray, unfocusedTextColor = Color.Gray, focusedIndicatorColor = Color.Blue, cursorColor = Color.Green, ) val enabled = true val isError = false val singleLine = true val textColor = LocalTextStyle.current.color.takeOrElse { customColors.textColor( enabled = enabled, isError = isError, focused = interactionSource.collectIsFocusedAsState().value, ) } BasicTextField( value = text, onValueChange = { text = it }, modifier = Modifier, interactionSource = interactionSource, enabled = enabled, singleLine = singleLine, // Colors of non-decoration-box elements (such as text color or cursor color) // must be passed to BasicTextField textStyle = LocalTextStyle.current.merge(TextStyle(color = textColor)), cursorBrush = SolidColor(customColors.cursorColor), decorationBox = { innerTextField -> TextFieldDefaults.DecorationBox( value = text, innerTextField = innerTextField, visualTransformation = VisualTransformation.None, singleLine = singleLine, enabled = enabled, isError = isError, interactionSource = interactionSource, container = { TextFieldDefaults.Container( enabled = enabled, isError = isError, interactionSource = interactionSource, colors = customColors, // Update indicator line thickness unfocusedIndicatorLineThickness = 2.dp, focusedIndicatorLineThickness = 4.dp, ) }, ) }, )
| Parameters | |
|---|---|
value: String |
the input |
innerTextField: @Composable () -> Unit |
input text field that this decoration box wraps. Pass the framework-controlled composable parameter |
enabled: Boolean |
the enabled state of the text field. When |
singleLine: Boolean |
indicates if this is a single line or multi line text field. This must be the same value that is passed to |
visualTransformation: VisualTransformation |
transforms the visual representation of the input |
interactionSource: InteractionSource |
the read-only |
isError: Boolean = false |
indicates if the text field's current value is in an error state. When |
label: (@Composable () -> Unit)? = null |
the optional label to be displayed with this text field. The default text style uses |
placeholder: (@Composable () -> Unit)? = null |
the optional placeholder to be displayed when the text field is in focus and the input text is empty. The default text style for internal |
leadingIcon: (@Composable () -> Unit)? = null |
the optional leading icon to be displayed at the beginning of the text field container |
trailingIcon: (@Composable () -> Unit)? = null |
the optional trailing icon to be displayed at the end of the text field container |
prefix: (@Composable () -> Unit)? = null |
the optional prefix to be displayed before the input text in the text field |
suffix: (@Composable () -> Unit)? = null |
the optional suffix to be displayed after the input text in the text field |
supportingText: (@Composable () -> Unit)? = null |
the optional supporting text to be displayed below the text field |
shape: Shape = TextFieldDefaults.shape |
defines the shape of this decoration box's container |
colors: TextFieldColors = colors() |
|
contentPadding: PaddingValues = if (label == null) {
contentPaddingWithoutLabel()
} else {
contentPaddingWithLabel()
} |
the padding between the input field and the surrounding elements of the decoration box. Note that the padding values may not be respected if they are incompatible with the text field's size constraints or layout. See |
container: @Composable () -> Unit = {
Container(
enabled = enabled,
isError = isError,
interactionSource = interactionSource,
modifier = Modifier,
colors = colors,
shape = shape,
focusedIndicatorLineThickness = FocusedIndicatorThickness,
unfocusedIndicatorLineThickness = UnfocusedIndicatorThickness,
)
} |
the container to be drawn behind the text field. By default, this uses |
colors
@Composable
fun colors(): TextFieldColors
Creates a TextFieldColors that represents the default input text, container, and content colors (including label, placeholder, icons, etc.) used in a TextField.
colors
@Composable
fun colors(
focusedTextColor: Color = Color.Unspecified,
unfocusedTextColor: Color = Color.Unspecified,
disabledTextColor: Color = Color.Unspecified,
errorTextColor: Color = Color.Unspecified,
focusedContainerColor: Color = Color.Unspecified,
unfocusedContainerColor: Color = Color.Unspecified,
disabledContainerColor: Color = Color.Unspecified,
errorContainerColor: Color = Color.Unspecified,
cursorColor: Color = Color.Unspecified,
errorCursorColor: Color = Color.Unspecified,
selectionColors: TextSelectionColors? = null,
focusedIndicatorColor: Color = Color.Unspecified,
unfocusedIndicatorColor: Color = Color.Unspecified,
disabledIndicatorColor: Color = Color.Unspecified,
errorIndicatorColor: Color = Color.Unspecified,
focusedLeadingIconColor: Color = Color.Unspecified,
unfocusedLeadingIconColor: Color = Color.Unspecified,
disabledLeadingIconColor: Color = Color.Unspecified,
errorLeadingIconColor: Color = Color.Unspecified,
focusedTrailingIconColor: Color = Color.Unspecified,
unfocusedTrailingIconColor: Color = Color.Unspecified,
disabledTrailingIconColor: Color = Color.Unspecified,
errorTrailingIconColor: Color = Color.Unspecified,
focusedLabelColor: Color = Color.Unspecified,
unfocusedLabelColor: Color = Color.Unspecified,
disabledLabelColor: Color = Color.Unspecified,
errorLabelColor: Color = Color.Unspecified,
focusedPlaceholderColor: Color = Color.Unspecified,
unfocusedPlaceholderColor: Color = Color.Unspecified,
disabledPlaceholderColor: Color = Color.Unspecified,
errorPlaceholderColor: Color = Color.Unspecified,
focusedSupportingTextColor: Color = Color.Unspecified,
unfocusedSupportingTextColor: Color = Color.Unspecified,
disabledSupportingTextColor: Color = Color.Unspecified,
errorSupportingTextColor: Color = Color.Unspecified,
focusedPrefixColor: Color = Color.Unspecified,
unfocusedPrefixColor: Color = Color.Unspecified,
disabledPrefixColor: Color = Color.Unspecified,
errorPrefixColor: Color = Color.Unspecified,
focusedSuffixColor: Color = Color.Unspecified,
unfocusedSuffixColor: Color = Color.Unspecified,
disabledSuffixColor: Color = Color.Unspecified,
errorSuffixColor: Color = Color.Unspecified
): TextFieldColors
Creates a TextFieldColors that represents the default input text, container, and content colors (including label, placeholder, icons, etc.) used in a TextField.
| Parameters | |
|---|---|
focusedTextColor: Color = Color.Unspecified |
the color used for the input text of this text field when focused |
unfocusedTextColor: Color = Color.Unspecified |
the color used for the input text of this text field when not focused |
disabledTextColor: Color = Color.Unspecified |
the color used for the input text of this text field when disabled |
errorTextColor: Color = Color.Unspecified |
the color used for the input text of this text field when in error state |
focusedContainerColor: Color = Color.Unspecified |
the container color for this text field when focused |
unfocusedContainerColor: Color = Color.Unspecified |
the container color for this text field when not focused |
disabledContainerColor: Color = Color.Unspecified |
the container color for this text field when disabled |
errorContainerColor: Color = Color.Unspecified |
the container color for this text field when in error state |
cursorColor: Color = Color.Unspecified |
the cursor color for this text field |
errorCursorColor: Color = Color.Unspecified |
the cursor color for this text field when in error state |
selectionColors: TextSelectionColors? = null |
the colors used when the input text of this text field is selected |
focusedIndicatorColor: Color = Color.Unspecified |
the indicator color for this text field when focused |
unfocusedIndicatorColor: Color = Color.Unspecified |
the indicator color for this text field when not focused |
disabledIndicatorColor: Color = Color.Unspecified |
the indicator color for this text field when disabled |
errorIndicatorColor: Color = Color.Unspecified |
the indicator color for this text field when in error state |
focusedLeadingIconColor: Color = Color.Unspecified |
the leading icon color for this text field when focused |
unfocusedLeadingIconColor: Color = Color.Unspecified |
the leading icon color for this text field when not focused |
disabledLeadingIconColor: Color = Color.Unspecified |
the leading icon color for this text field when disabled |
errorLeadingIconColor: Color = Color.Unspecified |
the leading icon color for this text field when in error state |
focusedTrailingIconColor: Color = Color.Unspecified |
the trailing icon color for this text field when focused |
unfocusedTrailingIconColor: Color = Color.Unspecified |
the trailing icon color for this text field when not focused |
disabledTrailingIconColor: Color = Color.Unspecified |
the trailing icon color for this text field when disabled |
errorTrailingIconColor: Color = Color.Unspecified |
the trailing icon color for this text field when in error state |
focusedLabelColor: Color = Color.Unspecified |
the label color for this text field when focused |
unfocusedLabelColor: Color = Color.Unspecified |
the label color for this text field when not focused |
disabledLabelColor: Color = Color.Unspecified |
the label color for this text field when disabled |
errorLabelColor: Color = Color.Unspecified |
the label color for this text field when in error state |
focusedPlaceholderColor: Color = Color.Unspecified |
the placeholder color for this text field when focused |
unfocusedPlaceholderColor: Color = Color.Unspecified |
the placeholder color for this text field when not focused |
disabledPlaceholderColor: Color = Color.Unspecified |
the placeholder color for this text field when disabled |
errorPlaceholderColor: Color = Color.Unspecified |
the placeholder color for this text field when in error state |
focusedSupportingTextColor: Color = Color.Unspecified |
the supporting text color for this text field when focused |
unfocusedSupportingTextColor: Color = Color.Unspecified |
the supporting text color for this text field when not focused |
disabledSupportingTextColor: Color = Color.Unspecified |
the supporting text color for this text field when disabled |
errorSupportingTextColor: Color = Color.Unspecified |
the supporting text color for this text field when in error state |
focusedPrefixColor: Color = Color.Unspecified |
the prefix color for this text field when focused |
unfocusedPrefixColor: Color = Color.Unspecified |
the prefix color for this text field when not focused |
disabledPrefixColor: Color = Color.Unspecified |
the prefix color for this text field when disabled |
errorPrefixColor: Color = Color.Unspecified |
the prefix color for this text field when in error state |
focusedSuffixColor: Color = Color.Unspecified |
the suffix color for this text field when focused |
unfocusedSuffixColor: Color = Color.Unspecified |
the suffix color for this text field when not focused |
disabledSuffixColor: Color = Color.Unspecified |
the suffix color for this text field when disabled |
errorSuffixColor: Color = Color.Unspecified |
the suffix color for this text field when in error state |
contentPaddingWithLabel
fun contentPaddingWithLabel(
start: Dp = TextFieldPadding,
end: Dp = TextFieldPadding,
top: Dp = TextFieldWithLabelVerticalPadding,
bottom: Dp = TextFieldWithLabelVerticalPadding
): PaddingValues
Default content padding of the input field within the TextField when there is an inside label. Note that the top padding represents the padding above the label in the focused state. The input field is placed directly beneath the label.
Horizontal padding represents the distance between the input field and the leading/trailing icons (if present) or the horizontal edges of the container if there are no icons.
contentPaddingWithoutLabel
fun contentPaddingWithoutLabel(
start: Dp = TextFieldPadding,
top: Dp = TextFieldPadding,
end: Dp = TextFieldPadding,
bottom: Dp = TextFieldPadding
): PaddingValues
Default content padding of the input field within the TextField when the label is null or positioned TextFieldLabelPosition.Above.
Horizontal padding represents the distance between the input field and the leading/trailing icons (if present) or the horizontal edges of the container if there are no icons.
decorator
@Composable
fun decorator(
state: TextFieldState,
enabled: Boolean,
lineLimits: TextFieldLineLimits,
outputTransformation: OutputTransformation?,
interactionSource: InteractionSource,
labelPosition: TextFieldLabelPosition = TextFieldLabelPosition.Attached(),
label: (@Composable TextFieldLabelScope.() -> Unit)? = null,
placeholder: (@Composable () -> Unit)? = null,
leadingIcon: (@Composable () -> Unit)? = null,
trailingIcon: (@Composable () -> Unit)? = null,
prefix: (@Composable () -> Unit)? = null,
suffix: (@Composable () -> Unit)? = null,
supportingText: (@Composable () -> Unit)? = null,
isError: Boolean = false,
colors: TextFieldColors = colors(),
contentPadding: PaddingValues = if (label == null || labelPosition is TextFieldLabelPosition.Above) { contentPaddingWithoutLabel() } else { contentPaddingWithLabel() },
container: @Composable () -> Unit = { Container( enabled = enabled, isError = isError, interactionSource = interactionSource, colors = colors, shape = shape, focusedIndicatorLineThickness = FocusedIndicatorThickness, unfocusedIndicatorLineThickness = UnfocusedIndicatorThickness, ) }
): TextFieldDecorator
A decorator used to create custom text fields based on Material Design filled text field.
If your text field requires customising elements that aren't exposed by TextField, such as the indicator line thickness, consider using this decorator to achieve the desired design.
For example, if you wish to customise the bottom indicator line, you can pass a custom Container to this decorator's container.
This decorator is meant to be used in conjunction with the overload of BasicTextField that accepts a TextFieldDecorator parameter. For other overloads of BasicTextField that use a decorationBox, see DecorationBox.
An example of building a custom text field using decorator:
import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.interaction.collectIsFocusedAsState import androidx.compose.foundation.text.BasicTextField import androidx.compose.foundation.text.input.TextFieldLineLimits import androidx.compose.foundation.text.input.rememberTextFieldState import androidx.compose.material3.LocalTextStyle import androidx.compose.material3.Text import androidx.compose.material3.TextField import androidx.compose.material3.TextFieldDefaults import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.graphics.takeOrElse import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp val state = rememberTextFieldState() val interactionSource = remember { MutableInteractionSource() } val customColors = TextFieldDefaults.colors( focusedTextColor = Color.DarkGray, unfocusedTextColor = Color.Gray, focusedIndicatorColor = Color.Blue, cursorColor = Color.Green, ) val enabled = true val isError = false val lineLimits = TextFieldLineLimits.SingleLine val textColor = LocalTextStyle.current.color.takeOrElse { customColors.textColor( enabled = enabled, isError = isError, focused = interactionSource.collectIsFocusedAsState().value, ) } BasicTextField( state = state, modifier = Modifier, interactionSource = interactionSource, enabled = enabled, lineLimits = lineLimits, // Colors of non-decorator elements (such as text color or cursor color) // must be passed to BasicTextField textStyle = LocalTextStyle.current.merge(TextStyle(color = textColor)), cursorBrush = SolidColor(customColors.cursorColor), decorator = TextFieldDefaults.decorator( state = state, outputTransformation = null, lineLimits = lineLimits, enabled = enabled, isError = isError, interactionSource = interactionSource, container = { TextFieldDefaults.Container( enabled = enabled, isError = isError, interactionSource = interactionSource, colors = customColors, // Update indicator line thickness unfocusedIndicatorLineThickness = 2.dp, focusedIndicatorLineThickness = 4.dp, ) }, ), )
| Parameters | |
|---|---|
state: TextFieldState |
|
enabled: Boolean |
the enabled state of the text field. When |
lineLimits: TextFieldLineLimits |
whether the text field is |
outputTransformation: OutputTransformation? |
|
interactionSource: InteractionSource |
the read-only |
labelPosition: TextFieldLabelPosition = TextFieldLabelPosition.Attached() |
the position of the label. See |
label: (@Composable TextFieldLabelScope.() -> Unit)? = null |
the optional label to be displayed with this text field. The default text style uses |
placeholder: (@Composable () -> Unit)? = null |
the optional placeholder to be displayed when the input text is empty. The default text style uses |
leadingIcon: (@Composable () -> Unit)? = null |
the optional leading icon to be displayed at the beginning of the text field container. |
trailingIcon: (@Composable () -> Unit)? = null |
the optional trailing icon to be displayed at the end of the text field container. |
prefix: (@Composable () -> Unit)? = null |
the optional prefix to be displayed before the input text in the text field. |
suffix: (@Composable () -> Unit)? = null |
the optional suffix to be displayed after the input text in the text field. |
supportingText: (@Composable () -> Unit)? = null |
the optional supporting text to be displayed below the text field. |
isError: Boolean = false |
indicates if the text field's current value is in an error state. When |
colors: TextFieldColors = colors() |
|
contentPadding: PaddingValues = if (label == null || labelPosition is TextFieldLabelPosition.Above) {
contentPaddingWithoutLabel()
} else {
contentPaddingWithLabel()
} |
the padding between the input field and the surrounding elements of the decorator. Note that the padding values may not be respected if they are incompatible with the text field's size constraints or layout. See |
container: @Composable () -> Unit = {
Container(
enabled = enabled,
isError = isError,
interactionSource = interactionSource,
colors = colors,
shape = shape,
focusedIndicatorLineThickness = FocusedIndicatorThickness,
unfocusedIndicatorLineThickness = UnfocusedIndicatorThickness,
)
} |
the container to be drawn behind the text field. By default, this uses |
indicatorLine
fun Modifier.indicatorLine(
enabled: Boolean,
isError: Boolean,
interactionSource: InteractionSource,
colors: TextFieldColors? = null,
textFieldShape: Shape? = null,
focusedIndicatorLineThickness: Dp = FocusedIndicatorThickness,
unfocusedIndicatorLineThickness: Dp = UnfocusedIndicatorThickness
): Modifier
A modifier to draw a default bottom indicator line for TextField. You can apply it to a BasicTextField to create a custom text field based on the styling of a Material filled text field.
Consider using Container, which automatically applies this modifier as well as other text field container styling.
| Parameters | |
|---|---|
enabled: Boolean |
whether the text field is enabled |
isError: Boolean |
whether the text field's current value is in error |
interactionSource: InteractionSource |
the |
colors: TextFieldColors? = null |
|
textFieldShape: Shape? = null |
the shape of the text field container. Used for clipping the indicator. If |
focusedIndicatorLineThickness: Dp = FocusedIndicatorThickness |
thickness of the indicator line when the text field is focused |
unfocusedIndicatorLineThickness: Dp = UnfocusedIndicatorThickness |
thickness of the indicator line when the text field is not focused |
outlinedTextFieldPadding
funoutlinedTextFieldPadding(
start: Dp = TextFieldPadding,
top: Dp = TextFieldPadding,
end: Dp = TextFieldPadding,
bottom: Dp = TextFieldPadding
): PaddingValues
textFieldWithLabelPadding
funtextFieldWithLabelPadding(
start: Dp = TextFieldPadding,
end: Dp = TextFieldPadding,
top: Dp = TextFieldWithLabelVerticalPadding,
bottom: Dp = TextFieldWithLabelVerticalPadding
): PaddingValues
textFieldWithoutLabelPadding
funtextFieldWithoutLabelPadding(
start: Dp = TextFieldPadding,
top: Dp = TextFieldPadding,
end: Dp = TextFieldPadding,
bottom: Dp = TextFieldPadding
): PaddingValues
Public properties
FocusedIndicatorThickness
val FocusedIndicatorThickness: Dp
The default thickness of the indicator line in TextField in focused state.
MinHeight
val MinHeight: Dp
The default min height applied to a TextField. Note that you can override it by applying Modifier.heightIn directly on a text field.
MinWidth
val MinWidth: Dp
The default min width applied to a TextField. Note that you can override it by applying Modifier.widthIn directly on a text field.
UnfocusedIndicatorThickness
val UnfocusedIndicatorThickness: Dp
The default thickness of the indicator line in TextField in unfocused state.