A role="alert" box listing field errors with anchor links to each field.
Place it above the form and move focus to it on a failed submit. Populated by
hand, or via shad_validator()'s bind_summary().
See also
Other shadshiny forms:
shad_field_group(),
shad_field_separator(),
shad_fieldset(),
shad_form_counter(),
shad_form_message(),
shad_rules,
shad_validator(),
update_shad_form_field()
Examples
shad_form_summary(
"errs", "2 fields need attention",
errors = c(email = "Email is not valid", pw = "Password too short")
)
#> <div class="shad-form-summary" id="errs" role="alert">
#> <div class="shad-form-summary__title">
#> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="M12 8v4M12 16h.01"/></svg>
#> 2 fields need attention
#> </div>
#> <ul class="shad-form-summary__list">
#> <li>
#> <a href="#email">Email is not valid</a>
#> </li>
#> <li>
#> <a href="#pw">Password too short</a>
#> </li>
#> </ul>
#> </div>