Optimized for: Gemini / ChatGPT / Claude
Advanced AI Prompt for Radix UI Dropdown with Async Shimmer States
Use this engineered prompt to drastically optimize your workflow and output.
Required Variables
- ✦
[API_ENDPOINT] - ✦
[LOADING_PATTERN] - ✦
[RETRY_LOGIC]
radix-dropdown-async-loading-a11y.txt
Build an accessible Radix UI Dropdown Menu that fetches its items from [API_ENDPOINT] upon opening. Implement a [LOADING_PATTERN] (e.g., Shimmer/Skeleton) that maintains focus and is announced as 'Loading' by screen readers. Handle edge cases: [RETRY_LOGIC] for failed fetches and empty states. Ensure the 'DropdownMenu.Content' does not shift layout abruptly once data loads. Use Radix's 'forceMount' if necessary for entrance animations. The output should include the fetching hook and the accessible ARIA-busy states.
Example Output
"The AI outputs a DropdownMenu component that uses a useEffect to trigger fetches onOpenChange, utilizing skeleton items with role='menuitem' to maintain keyboard navigation during the load."