Skip to main content

FormFieldControl

Inherits: LayoutControl

Properties

Methods

  • focus - Request focus for this control.

Properties

align_label_with_hintclass-attributeinstance-attribute

align_label_with_hint: Optional[bool] = None

TBD

bgcolorclass-attributeinstance-attribute

bgcolor: Optional[ColorValue] = None

TextField background color.

Note

Will not be visible if filled is False.

borderclass-attributeinstance-attribute

Border around input.

border_colorclass-attributeinstance-attribute

border_color: Optional[ColorValue] = None

The border color.

Tip

Set to flet.Colors.TRANSPARENT to invisible/hide the border.

border_radiusclass-attributeinstance-attribute

border_radius: Optional[BorderRadiusValue] = None

border_widthclass-attributeinstance-attribute

border_width: Optional[Number] = None

The width of the border in virtual pixels.

Defaults to 1.

Tip

Set to 0 to completely remove the border.

collapsedclass-attributeinstance-attribute

collapsed: Optional[bool] = None

TBD

colorclass-attributeinstance-attribute

color: Optional[ColorValue] = None

Text color.

content_paddingclass-attributeinstance-attribute

content_padding: Optional[PaddingValue] = None

The padding for the input decoration's container.

counterclass-attributeinstance-attribute

counter: Optional[StrOrControl] = None

A Control to place below the line as a character count.

If None or an empty string then nothing will appear in the counter's location.

counter_styleclass-attributeinstance-attribute

counter_style: Optional[TextStyle] = None

The text style to use for counter.

denseclass-attributeinstance-attribute

dense: Optional[bool] = None

Whether this control is part of a dense form (ie, uses less vertical space).

errorclass-attributeinstance-attribute

error: Optional[StrOrControl] = None

Text that appears below the input border.

If non-null, the border's color animates to red and the helper is not shown.

error_max_linesclass-attributeinstance-attribute

error_max_lines: Optional[int] = None

TBD

error_styleclass-attributeinstance-attribute

error_style: Optional[TextStyle] = None

The text style to use for error.

fill_colorclass-attributeinstance-attribute

fill_color: Optional[ColorValue] = None

Background color of TextField.

Note

Will not be visible if filled is False.

filledclass-attributeinstance-attribute

filled: Optional[bool] = None

If True the decoration's container is filled with theme fill_color.

If filled=None (the default), then it is implicitly set to True when at least one of the following is not None: fill_color, focused_bgcolor, hover_color and bgcolor.

fit_parent_sizeclass-attributeinstance-attribute

fit_parent_size: Optional[bool] = None

TBD

focus_colorclass-attributeinstance-attribute

focus_color: Optional[ColorValue] = None

TBD

focused_bgcolorclass-attributeinstance-attribute

focused_bgcolor: Optional[ColorValue] = None

Background color in focused state.

Note

Will not be visible if filled is False.

focused_border_colorclass-attributeinstance-attribute

focused_border_color: Optional[ColorValue] = None

Border color in focused state.

focused_border_widthclass-attributeinstance-attribute

focused_border_width: Optional[Number] = None

Border width in focused state.

focused_colorclass-attributeinstance-attribute

focused_color: Optional[ColorValue] = None

The text's color when focused.

helperclass-attributeinstance-attribute

helper: Optional[StrOrControl] = None

Text that provides context about the input's value, such as how the value will be used.

If non-null, the text is displayed below the input decorator, in the same location as error. If a non-null error value is specified then the helper text is not shown.

helper_max_linesclass-attributeinstance-attribute

helper_max_lines: Optional[int] = None

TBD

helper_styleclass-attributeinstance-attribute

helper_style: Optional[TextStyle] = None

The text style to use for helper.

hint_fade_durationclass-attributeinstance-attribute

hint_fade_duration: Optional[DurationValue] = None

TBD

hint_max_linesclass-attributeinstance-attribute

hint_max_lines: Optional[int] = None

TBD

hint_styleclass-attributeinstance-attribute

hint_style: Optional[TextStyle] = None

The text style to use for hint_text.

hint_textclass-attributeinstance-attribute

hint_text: Optional[str] = None

Text that suggests what sort of input the field accepts.

Displayed on top of the input when the it's empty and either (a) label is None or (b) the input has the focus.

hover_colorclass-attributeinstance-attribute

hover_color: Optional[ColorValue] = None

Background color of TextField when hovered.

Note

Will not be visible if filled is False.

iconclass-attributeinstance-attribute

icon: Optional[IconDataOrControl] = None

The icon to show before the input field and outside of the decoration's container.

labelclass-attributeinstance-attribute

label: Optional[StrOrControl] = None

Optional text that describes the input field.

When the input field is empty and unfocused, the label is displayed on top of the input field (i.e., at the same location on the screen where text may be entered in the input field). When the input field receives focus (or if the field is non-empty) the label moves above, either vertically adjacent to, or to the center of the input field.

label_styleclass-attributeinstance-attribute

label_style: Optional[TextStyle] = None

The text style to use for label.

prefixclass-attributeinstance-attribute

prefix: Optional[StrOrControl] = None

A Control to place on the line before the input.

It appears after the prefix_icon, if both are specified.

This can be used, for example, to add some padding to text that would otherwise be specified using prefix, or to add a custom control in front of the input. The control's baseline is lined up with the input baseline.

prefix_iconclass-attributeinstance-attribute

prefix_icon: Optional[IconDataOrControl] = None

An icon that appears before the editable part of the text field, within the decoration's container.

If prefix is specified and visible, this icon will appear to its left.

prefix_icon_size_constraintsclass-attributeinstance-attribute

prefix_icon_size_constraints: Optional[BoxConstraints] = None

TBD

prefix_styleclass-attributeinstance-attribute

prefix_style: Optional[TextStyle] = None

The text style to use for prefix.

size_constraintsclass-attributeinstance-attribute

size_constraints: Optional[BoxConstraints] = None

TBD

suffixclass-attributeinstance-attribute

suffix: Optional[StrOrControl] = None

A Control to place on the line after the input.

It appears before the suffix_icon, if both are specified.

This can be used, for example, to add some padding to the text that would otherwise be specified using suffix, or to add a custom control after the input. The control's baseline is lined up with the input baseline.

suffix_iconclass-attributeinstance-attribute

suffix_icon: Optional[IconDataOrControl] = None

An icon that appears after the editable part of the text field and after the suffix, within the decoration's container.

suffix_icon_size_constraintsclass-attributeinstance-attribute

suffix_icon_size_constraints: Optional[BoxConstraints] = None

TBD

suffix_styleclass-attributeinstance-attribute

suffix_style: Optional[TextStyle] = None

The text style to use for suffix.

text_sizeclass-attributeinstance-attribute

text_size: Optional[Number] = None

Text size in virtual pixels.

text_styleclass-attributeinstance-attribute

text_style: Optional[TextStyle] = None

The TextStyle to use for the text being edited.

text_vertical_alignclass-attributeinstance-attribute

text_vertical_align: Optional[Union[VerticalAlignment, Number]] = None

Defines how the text should be aligned vertically.

Value can either be a number ranging from -1.0 (topmost location) to 1.0 (bottommost location) or of type VerticalAlignment Defaults to VerticalAlignment.CENTER.

Methods

focusasync

focus()

Request focus for this control.

Example
async def main(page: ft.Page):
page.add(ctf := ft.TextField())
await ctf.focus()