DESY

Sistema de Diseño del Gobierno de Aragón.

Mensaje de error

En caso de que el campo requiera validación o sea obligatorio, puede aparecer un error indicando el problema con el dato introducido.

Error-message

Mostrar parámetros

Parámetros del componente

              params:
- name: text
  type: string
  required: true
  description: If `html` is set, this is not required. Text to use within the error message. If `html` is provided, the `text` argument will be ignored.
- name: html
  type: string
  required: true
  description: If `text` is set, this is not required. HTML to use within the error message. If `html` is provided, the `text` argument will be ignored.
- name: id
  type: string
  required: false
  description: Id attribute to add to the error message span tag.
- name: classes
  type: string
  required: false
  description: Classes to add to the error message span tag.
- name: attributes
  type: object
  required: false
  description: HTML attributes (for example data attributes) to add to the error message span tag
- name: visuallyHiddenText
  type: string
  description: A visually hidden prefix used before the error message. Defaults to "Error".
              
            

Por defecto

Error:Error: esto es un mensaje de error

Mostrar códigodel ejemplo: Por defecto

Contenido

Nunjucks macro

{% from "components/error-message/_macro.error-message.njk" import componentErrorMessage %}

{{ componentErrorMessage({
  "text": "Error: esto es un mensaje de error"
}) }}

Con html

Error:Error: esto es un mensaje de error con HTML

Mostrar códigodel ejemplo: Con html

Contenido

Nunjucks macro

{% from "components/error-message/_macro.error-message.njk" import componentErrorMessage %}

{{ componentErrorMessage({
  "html": "Error: esto es un <em>mensaje de error con HTML</em>"
}) }}