Source set: Common
public abstract class TextFieldLabelPosition private constructor()
The position of the label with respect to the text field.
Members
Attached
Source set: Common
@Deprecated(
"Use Inside for the default filled TextField behavior, or Cutout for the " +
"default OutlinedTextField behavior."
)
public class Attached(
@get:Suppress("GetterSetterNames") public val alwaysMinimize: Boolean = false,
public val minimizedAlignment: Alignment.Horizontal = Alignment.Start,
public val expandedAlignment: Alignment.Horizontal = Alignment.Start,
) : TextFieldLabelPosition()
Translates to Inside for TextField, and Cutout for OutlinedTextField.
Parameters
| alwaysMinimize | Whether to always keep the label of the text field minimized. If false, the label will expand to occupy the input area when the text field is unfocused and empty. If true, this allows displaying the placeholder, prefix, and suffix alongside the label when the text field is unfocused and empty. |
| minimizedAlignment | The horizontal alignment of the label when it is minimized. |
| expandedAlignment | The horizontal alignment of the label when it is expanded. |
Inside
Source set: Common
public class Inside(
public val isAlwaysMinimized: Boolean = false,
public val minimizedAlignment: Alignment.Horizontal = Alignment.Start,
public val expandedAlignment: Alignment.Horizontal = Alignment.Start,
) : TextFieldLabelPosition()
The label is positioned inside the text field container.
This is the default label position for TextField.
Parameters
| isAlwaysMinimized | Whether to always keep the label of the text field minimized. If false, the label will expand to occupy the input area when the text field is unfocused and empty. If true, this allows displaying the placeholder, prefix, and suffix alongside the label when the text field is unfocused and empty. |
| minimizedAlignment | The horizontal alignment of the label when it is minimized. |
| expandedAlignment | The horizontal alignment of the label when it is expanded. |
Cutout
Source set: Common
public class Cutout(
public val isAlwaysMinimized: Boolean = false,
public val minimizedAlignment: Alignment.Horizontal = Alignment.Start,
public val expandedAlignment: Alignment.Horizontal = Alignment.Start,
) : TextFieldLabelPosition()
The label is positioned inside the text field container when expanded and cuts into the border when minimized.
This is the default label position for OutlinedTextField.
Parameters
| isAlwaysMinimized | Whether to always keep the label of the text field minimized. If false, the label will expand to occupy the input area when the text field is unfocused and empty. If true, this allows displaying the placeholder, prefix, and suffix alongside the label when the text field is unfocused and empty. |
| minimizedAlignment | The horizontal alignment of the label when it is minimized. |
| expandedAlignment | The horizontal alignment of the label when it is expanded. |
Above
Source set: Common
public class Above(public val alignment: Alignment.Horizontal = Alignment.Start) :
TextFieldLabelPosition()
The label is positioned above and outside the text field container. This results in the label always being minimized.
Parameters
| alignment | The horizontal alignment of the label. |