Field errors

errors parameter of the input accepts list of error messages. When there are errors, the input will be styled with error styles and error messages will be shown below the input.

There is a separate component field_errors that renders list of errors, but it may require placing input and errors in the same wrapper element to work properly, so using the errors parameter of the input is usually easier.

{%- call ui.util.call(show_example) -%} {%- raw %} {{ ui.input(name="name", label="Name", errors=["Cannot be empty", "Letters only"]) }} {%- call ui.util.call(ui.input, name="errors", label="Manual errors") -%} {{ ui.field_errors(["First error", "Second error"]) }} {%- endcall %} {%- endraw %} {%- endcall %}