Focus First Invalid

Place <RzFocusFirstInvalid /> inside a form. When the form renders with validation errors, typically after the server answered 422 and htmx swapped it in, focus moves to the first invalid field, so keyboard and screen reader users land on the problem. For controls that hide their native element (comboboxes, visually hidden checkboxes and switches), the visible control of the same field takes focus.

Usage

Source
<EditForm Model="Model" FormName="contact" hx-post="/contact" hx-swap="outerHTML">
    <RzFocusFirstInvalid />
    <RzModelStateProvider />
    ...
</EditForm>

It renders a hidden element and has no parameters of its own.