A field-level validation line (error / success / warning / info) or a
right-aligned character counter, matching shadcn's form messaging. Place
inside a shad_form_field() after the control. For server-driven errors,
prefer update_shad_form_field() / the shad_validator() framework, which
create and remove these for you.
Usage
shad_form_message(
message,
type = c("info", "error", "success", "warning"),
icon = TRUE,
id = NULL,
class = NULL
)See also
Other shadshiny forms:
shad_field_group(),
shad_field_separator(),
shad_fieldset(),
shad_form_counter(),
shad_form_summary(),
shad_rules,
shad_validator(),
update_shad_form_field()
Examples
shad_form_message("Enter a valid email address.", type = "error")
#> <div class="shad-form-message shad-form-message--error">
#> <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>
#> Enter a valid email address.
#> </div>
shad_form_message("Username is available.", type = "success")
#> <div class="shad-form-message shad-form-message--success">
#> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 12l5 5L20 7"/></svg>
#> Username is available.
#> </div>