Back to API Reference
Class
FieldDecorator
abstract
Inherits:InputBehavior
Base class for state-driven field visuals: placeholder, floating label, supporting text, character counter, or validation feedback. It participates in the ordinary InputBehavior lifecycle and appears in the editor's behavior type picker.
Derived Types(4)
Types that inherit from FieldDecorator.
CCCC
CharacterCounterDecorator
Shows the current length — count, or count/limit when a [[LengthLimitBehavior]] publishes a cap — counting in the cap's [[TextLengthUnit]] (grapheme clusters when there is no cap), and recolors once the count reaches the limit. Counts the document SOURCE — the same space [[LengthLimitBehavior]] enforces in, so count and cap always agree; in a field with hidden markup the count therefore includes the markup characters, not just the visible text.
FloatingLabelDecorator
Animates a label between its resting position (inside the field) and a floated position (typically the top edge), scaling it down on the way; the label stays visible throughout. For a different motion model — a tween library, a path — write your own [[FieldDecorator]].
PlaceholderDecorator
Shows a target while the field is empty and hides it once there is text. The classic placeholder.
SupportingTextDecorator
Drives a text target with helper text, replacing it with the validation message and an error color while the field is invalid. The supporting-text slot of a form field.
