Skip to main content

QuestionnaireContent.Error

Displays form validation errors and submission errors with proper accessibility announcements.

Overview

The QuestionnaireContent.Error component automatically displays error messages from the form context, provides custom error message override support, and ensures proper accessibility announcements for screen readers. It integrates seamlessly with the form validation system to provide immediate feedback to users.

Props

PropTypeDefaultDescription
styleStyleProp<ViewStyle>undefinedCustom styles for the error container
...textPropsTextProps-All other Text props (accessibility, testID, etc.)

Features

  • Automatic Error Display: Shows error messages from form context automatically
  • Custom Error Override: Support for custom error messages through children prop
  • Accessibility Announcements: Proper screen reader announcements for errors
  • Theme Integration: Uses theme error colors and typography
  • Dismissible Display: Optional error dismissal functionality

Styling

Theme Colors

  • theme.colors.error - Error text color
  • theme.colors.errorContainer - Error background color
  • theme.colors.onErrorContainer - Error container text color
  • theme.fonts.bodySmall - Default error typography