A message about what the user typed: usually an error, sometimes a warning or a confirmation.
Mirrors ValidationMessage from @digdir/designsystemet-react.
ValidationMessage.view [] [ Html.text "Skriv inn et gyldig fødselsnummer" ]
ValidationMessage.view [ ValidationMessage.severity Color.Success ]
[ Html.text "Brukernavnet er ledig" ]A message is an error unless you give it another severity.
Inside a Field, <ds-field> links the message to the
input with aria-describedby, and an error also makes the input
aria-invalid="true". Messages of other severities are linked but don't make
the input invalid. As a direct child of a
Fieldset, the message is linked to every field in
the group.
The composites (Textfield,
Checkbox, …) render this from withError.
<ValidationMessage> → ValidationMessage.view []data-color="warning" → ValidationMessage.severity Color.WarningasChild + <div> → ValidationMessage.viewAs Html.div []The message on another element (React's asChild).
A
<p class="ds-validation-message" data-field="validation">.