cem-input is text input component from <custom-element> Material suite based on the
Material Design specification,
text fields in particular.
Other implementations: Material Web(Lit), Angular Material
Attributes
leading, label, trailing, supporting attributes define the text when slot
with same name is omitted.
label attribute defines the label text.
Slots
leading placeholder for leading iconlabel placeholder for label texttrailing placeholder for trailing iconsupporting placeholder for supporting textwarn warning text,
warn slot content would overlap the supporting slot when not empty.
Default slot implementation is sensitive to validationMessage property.
Error handling and styling
Something small enough to escape casual notice.leading slot inserted before input,
trailing slot injected aftertrailing and other slots can become functional Those slots can be used for error or hint UI; persistent or triggered by hover/focus.
cem-autocomplete uses trailing slot for
menu with suggestions.
Click in input field to see the focus leading icon
custom-element form handling required attribute would trigger the system message if the field is empty.warn attribute and slot is used for warning messagesupporting attribute and slot is used for supplementary message,
hidden when warn is not empty Underlying implementation uses HTML input. All its attributes are supported.