FormFieldControl
Base class for Material form-field controls with a decorated input area.
It provides the shared label, hint, helper, error, prefix, suffix, fill, and
border properties used by controls such as TextField and
DropdownM2.
Inherits: LayoutControl
Properties
align_label_with_hint- Whether the floating label should align withhint_text.bgcolor- TextField background color.border- Border around input.border_color- The border color.border_radius- Rounds the corners of the outlined decoration border.border_width- The width of the border in virtual pixels.collapsed- Whether the decoration should be the same size as the input field.color- Text color.content_padding- The padding for the input decoration's container.counter- AControlto place below the line as a character count.counter_style- The text style to use forcounter.dense- Whether this control is part of a dense form (ie, uses less vertical space).error- Text that appears below the input border.error_max_lines- The maximum number of lines theerrorcan occupy.error_style- The text style to use forerror.fill_color- Background color of TextField.filled- Whether the decoration's container is filled withfill_color.fit_parent_size- Whether the editable area should expand to fill the height of its parent.focus_color- The fill color of the decoration's container when the control has input focus.focused_bgcolor- Background color in focused state.focused_border_color- Border color in focused state.focused_border_width- Border width in focused state.focused_color- The text's color when focused.helper- Text that provides context about the input's value, such as how the value will be used.helper_max_lines- The maximum number of lines thehelpercan occupy.helper_style- The text style to use forhelper.hint_fade_duration- The duration of thehint_textfade-in and fade-out animations.hint_max_lines- The maximum number of lines thehint_textcan occupy.hint_style- The text style to use forhint_text.hint_text- Text that suggests what sort of input the field accepts.hover_color- Background color of TextField when hovered.icon- The icon to show before the input field and outside of the decoration's container.label- Optional text that describes the input field.label_style- The text style to use forlabel.prefix- AControlto place on the line before the input.prefix_icon- An icon that appears before the editable part of the text field, within the decoration's container.prefix_icon_size_constraints- Size constraints for the area surroundingprefix_icon.prefix_style- The text style to use forprefix.size_constraints- Defines the minimum and maximum size of the input decorator.suffix- AControlto place on the line after the input.suffix_icon- An icon that appears after the editable part of the text field and after thesuffix, within the decoration's container.suffix_icon_size_constraints- Size constraints for the area surroundingsuffix_icon.suffix_style- The text style to use forsuffix.text_size- Text size in virtual pixels.text_style- TheTextStyleto use for the text being edited.text_vertical_align- Defines how the text should be aligned vertically.
Methods
focus- Request focus for this control.
Properties
align_label_with_hintclass-attributeinstance-attribute
align_label_with_hint: bool | None = NoneWhether the floating label should align with hint_text.
This is typically set to True for multiline text input to align the label with
the top of the hint instead of centering it vertically.
bgcolorclass-attributeinstance-attribute
bgcolor: ColorValue | None = NoneTextField background color.
Note
Will not be visible if filled is False.