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.
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.
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.
<.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.
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.
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):
8. Estrategias de temporización de validación
When to trigger validation affects user experience significantly.
Al escribir (en tiempo real)
Al perder el foco (recomendado)
Al enviar
9. Validación multicampo / entre campos
When validation depends on multiple fields (e.g., password confirmation, date ranges).
10. Validación progresiva (formularios de varios pasos)
Validate each step before allowing progression. Prevents users from reaching the end with invalid data.
Cuenta
Perfil
Confirmar
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 inputpa-input--warning- Warning border on inputpa-input--error- Error border on input
Texto de ayuda/mensaje
pa-form-help- Base help text stylingpa-form-help--success- Green help textpa-form-help--warning- Yellow/orange help textpa-form-help--error- Red help text
Variantes de alerta (para bloques de resumen)
pa-alert pa-alert--danger- Error summary blockpa-alert pa-alert--warning- Warning summary blockpa-alert pa-alert--success- Success message blockpa-alert pa-alert--info- Info message block
Clases de utilidad de texto
text-danger- Red text colortext-warning- Yellow/orange text colortext-success- Green text colortext-secondary- Muted/gray text color