Message
Inline feedback on a page or in a form, plus the hint and the validation error under a field.
Severities
Eight severities. danger and warn are announced at once (role="alert"), the others politely.
Variants
A tinted box by default; outlined drops the fill, text drops the box, simple also drops the padding — for a line under a field or inside a table.
Sizes
small, medium (default) and large.
Icons
No icon unless you set one. A tectra icon name (also with the pi- prefix), an icon class, or your own markup in <ng-template txMessageIcon>.
Content
Without text the message shows its content — links, buttons, several lines.
Closable
closable adds a close button; (closed) reports it. Your own icon goes into <ng-template txMessageCloseIcon>.
Life
life closes the message after that many milliseconds.
Field hint
<tx-field-hint for="id"> sits under a field and is added to its aria-describedby, so screen readers read it with the field. severity="success" and an icon for a positive note.
Field error
<tx-field-error [control]> shows the first error of the control once it is touched or changed — submit marks every field touched. Texts come from the locale. The field turns red by itself.
Custom messages
Own texts per error key through messages — a string with {param} from the error object, or a function. A validator can also return { key: { message } }. App-wide texts go to provideTectra({ validationMessages }).
Success
successText appears when the control holds a valid value and was touched or changed.
Design tokens
[dt] changes the message tokens of one message.
Pass through
[pt] adds classes and styles to the parts: root, icon, content, closeButton.