Different UI patterns for displaying form validation errors. Choose the pattern that best fits your UX requirements.

1. Errores de campo en línea

The most common pattern. Error messages appear directly below each field. Best for forms where users need immediate field-level feedback.

Introduce una dirección de correo electrónico válida
La contraseña debe tener al menos 8 caracteres
El nombre de usuario está disponible
Considera añadir el código de país para el formato internacional
Usage: Add pa-form-group--error to the form group and pa-form-help--error to the help text.

2. Bloque de resumen (parte superior del formulario)

All errors collected in a single alert at the top. Good for accessibility and giving users a quick overview of all issues.

Best Practice: Combine summary block with inline errors for maximum accessibility. Screen readers can announce all errors at once.

3. Combinado: resumen + en línea (recomendado)

The best of both worlds. Summary for overview, inline for specific guidance. This section is built with <.form_error_summary> and <.form_field> — the higher-level orchestrators that mirror svelte's FormErrorSummary / FormField.

Formato de número de tarjeta no válido. Usa 16 dígitos.
Válido
Debe tener 3 o 4 dígitos
Tip: <.form_error_summary> renders clickable links that jump to each field via its id; <.form_field> wires the label, control, and help/error text in one tag.

4. Solo borde + icono (Minimal)

Space-efficient but less informative. Red border and icon indicate error without text message. User must infer the issue or hover/click for details.

Caution: This pattern provides poor accessibility. Consider using tooltips or aria-describedby for screen readers.

5. Indicadores del lado derecho

Error text positioned to the right of the input. Works well in horizontal form layouts with more screen real estate.

El nombre de la empresa es obligatorio
Introduce una URL válida (p. ej., https://example.com)
Valid selection

6. El texto de ayuda se transforma en error

Helper text below the field transforms into error text when validation fails. Maintains consistent spacing.

7. Notificaciones Toast

Validation errors shown as toast notifications. Best for submit-level errors or async validation (e.g., server-side checks).

Toast preview (normally appears in corner):

La validación falló
Credenciales no válidas. Comprueba tu correo electrónico y contraseña.
Note: Toasts are ephemeral. Don't use them as the only validation feedback - users may miss them.

8. Estrategias de temporización de validación

When to trigger validation affects user experience significantly.

Al escribir (en tiempo real)

Escribe para ver la validación
Validates as user types. Can feel aggressive.

Al perder el foco (recomendado)

Haz clic fuera para validar
Validates when field loses focus. Good balance.

Al enviar

Envía para validar
All errors shown at once on submit. Traditional approach.

9. Validación multicampo / entre campos

When validation depends on multiple fields (e.g., password confirmation, date ranges).

Mín. 8 caracteres, mayúscula, número, carácter especial
Vuelve a introducir tu contraseña

10. Validación progresiva (formularios de varios pasos)

Validate each step before allowing progression. Prevents users from reaching the end with invalid data.

1

Cuenta

2

Perfil

3

Confirmar

El nombre para mostrar es obligatorio
URL válida

Referencia de clases CSS

Estados de grupo de formulario

  • pa-form-group--success - Success state (green)
  • pa-form-group--warning - Warning state (yellow/orange)
  • pa-form-group--error - Error state (red)

Estados de campo

  • pa-input--success - Success border on input
  • pa-input--warning - Warning border on input
  • pa-input--error - Error border on input

Texto de ayuda/mensaje

  • pa-form-help - Base help text styling
  • pa-form-help--success - Green help text
  • pa-form-help--warning - Yellow/orange help text
  • pa-form-help--error - Red help text

Variantes de alerta (para bloques de resumen)

  • pa-alert pa-alert--danger - Error summary block
  • pa-alert pa-alert--warning - Warning summary block
  • pa-alert pa-alert--success - Success message block
  • pa-alert pa-alert--info - Info message block

Clases de utilidad de texto

  • text-danger - Red text color
  • text-warning - Yellow/orange text color
  • text-success - Green text color
  • text-secondary - Muted/gray text color

John Doe

Administrator

Configuración

Press Ctrl+K to preview the palette.
Sidebar
Display
Profile Panel
Body text size. All elements scale proportionally.
Comandos
🚀
Desplegar a entorno
Desplegar una rama a un entorno
g d
👤
Asignar a usuario
Asignar un elemento a un miembro del equipo
g a
🧭
Ir a la página
Navegar a una página
g g
🎨
Cambiar tema
Cambiar el tema visual
g t
Buscar
📦
Productos
Buscar productos
:products
📋
Pedidos
Buscar pedidos
:orders
👥
Usuarios
Buscar usuarios
:users
🧾
Facturas
Buscar facturas
:invoices