InputDecorationTheme
Customizes the decoration of descendant TextField and
Dropdown controls: their border, label, hint and helper
styles, padding and fill.
A control's own properties win over the theme. A control with no
border uses the theme's border.
A soft resting border that darkens on hover and turns to the primary color on focus:
page.theme = ft.Theme(
input_decoration_theme=ft.InputDecorationTheme(
border=ft.OutlineInputBorder(
border_radius=8,
side=ft.BorderSide(
color=ft.Colors.with_opacity(0.24, ft.Colors.ON_SURFACE)
),
),
label_style=ft.TextStyle(size=14),
hint_style=ft.TextStyle(size=14),
),
)
Properties
align_label_with_hint- Whether the label aligns with the hint text in multiline fields, rather than being vertically centered.border- The border drawn around the decorated input area, for every state.content_padding- The padding around the input text and label.counter_style- The style of the counter text.dense- Whether fields use less vertical space.error_style- The style of the error text.fill_color- The fill color of filled fields.filled- Whether fields are filled withfill_color.floating_label_style- The style of the label when it floats above the field.focus_color- The fill color of filled fields while focused.helper_style- The style of the helper text.hint_style- The style of the hint text.hover_color- The fill color of filled fields while hovered.icon_color- The color of the icon in front of the field.label_style- The style of the label when it sits inside the field.prefix_icon_color- The color of the prefix icon.prefix_style- The style of the prefix text.size_constraints- The size constraints of the decorated input area.suffix_icon_color- The color of the suffix icon.suffix_style- The style of the suffix text.
Properties
align_label_with_hintclass-attributeinstance-attribute
align_label_with_hint: bool | None = NoneWhether the label aligns with the hint text in multiline fields, rather than being vertically centered.
borderclass-attributeinstance-attribute
border: ControlStateValue[InputBorder] | None = NoneThe border drawn around the decorated input area, for every state.
Accepts a single InputBorder or a dictionary mapping
ControlStates to InputBorders. Supported
state keys are DEFAULT,
HOVERED, FOCUSED,
ERROR and DISABLED.
The DEFAULT entry (or the single border) sets the shape for all states
and the line for the resting state only. Each other state uses the side
of its own entry if given, otherwise the Material default for that state -
so setting only a soft resting color keeps the darker hover line and the
primary-colored, thicker focus line.
content_paddingclass-attributeinstance-attribute
content_padding: PaddingValue | None = NoneThe padding around the input text and label.
counter_styleclass-attributeinstance-attribute
counter_style: TextStyle | None = NoneThe style of the counter text.
denseclass-attributeinstance-attribute
dense: bool | None = NoneWhether fields use less vertical space.
error_styleclass-attributeinstance-attribute
error_style: TextStyle | None = NoneThe style of the error text.
fill_colorclass-attributeinstance-attribute
fill_color: ColorValue | None = NoneThe fill color of filled fields.
filledclass-attributeinstance-attribute
filled: bool | None = NoneWhether fields are filled with fill_color.
floating_label_styleclass-attributeinstance-attribute
floating_label_style: TextStyle | None = NoneThe style of the label when it floats above the field.
focus_colorclass-attributeinstance-attribute
focus_color: ColorValue | None = NoneThe fill color of filled fields while focused.
helper_styleclass-attributeinstance-attribute
helper_style: TextStyle | None = NoneThe style of the helper text.
hint_styleclass-attributeinstance-attribute
hint_style: TextStyle | None = NoneThe style of the hint text.
hover_colorclass-attributeinstance-attribute
hover_color: ColorValue | None = NoneThe fill color of filled fields while hovered.
icon_colorclass-attributeinstance-attribute
icon_color: ColorValue | None = NoneThe color of the icon in front of the field.
label_styleclass-attributeinstance-attribute
label_style: TextStyle | None = NoneThe style of the label when it sits inside the field.
prefix_icon_colorclass-attributeinstance-attribute
prefix_icon_color: ColorValue | None = NoneThe color of the prefix icon.
prefix_styleclass-attributeinstance-attribute
prefix_style: TextStyle | None = NoneThe style of the prefix text.
size_constraintsclass-attributeinstance-attribute
size_constraints: BoxConstraints | None = NoneThe size constraints of the decorated input area.
suffix_icon_colorclass-attributeinstance-attribute
suffix_icon_color: ColorValue | None = NoneThe color of the suffix icon.