Optimized for: Gemini / ChatGPT / Claude
Advanced AI Prompt for Radix UI Dialog with Content Form Validation Errors
Use this engineered prompt to drastically optimize your workflow and output.
Required Variables
- ✦
[ERROR_SUMMARY_STRATEGY] - ✦
[FIELD_LEVEL_ANNOUNCEMENT] - ✦
[FOCUS_ON_ERROR]
radix-dialog-validation-errors-a11y.txt
Design a Radix UI Dialog containing a form that implements a robust [ERROR_SUMMARY_STRATEGY]. When the form is submitted with errors, the Dialog must focus the [FOCUS_ON_ERROR] (either the first error field or an error summary box). Implement [FIELD_LEVEL_ANNOUNCEMENT] using aria-invalid and aria-describedby for each input. Ensure that as errors are corrected, the screen reader provides updated feedback. Detail how to prevent the Dialog from closing until a successful submission occurs, while keeping the 'Close' button functional for cancellation.
Example Output
"The AI outputs a form-integrated Dialog that uses React Hook Form and Radix, featuring an auto-focusing error summary that satisfies WCAG 3.3.1."