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
| Prop | Type | Default | Description |
|---|---|---|---|
style | StyleProp<ViewStyle> | undefined | Custom styles for the error container |
...textProps | TextProps | - | 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 colortheme.colors.errorContainer- Error background colortheme.colors.onErrorContainer- Error container text colortheme.fonts.bodySmall- Default error typography