Blenra LogoBlenra
Optimized for: Gemini / ChatGPT / Claude
#UI

Advanced AI Prompt for Persistent State Modals in SPAs

Customize the variables below to instantly engineer your prompt.

Required Variables

radix-persistent-state-modal.txt
Act as a Single Page Application (SPA) Routing Expert. Develop a Radix UI Dialog architecture that bi-directionally synchronizes its internal 'open' state with a specific [URL_QUERY_PARAM] (e.g., '?modal=settings'). Utilize the router's [BROWSER_HISTORY_ACTION] (Push vs Replace) to allow users to utilize the native browser 'Back' button to gracefully close the modal. Implement rock-solid [SYNC_LOGIC] within a 'useEffect' to handle edge cases where a user lands on the page via a shared URL with the modal query already present. Explicitly address the accessibility requirement of 'Initial Focus Management' when a modal is forcefully opened on the initial page load by the routing engine.

Example Text Output

"The AI generates a wrapper that monitors the URL search params, automatically opening or closing the Radix Dialog and managing focus accordingly."

More Web Components Prompts

View all →

Frequently Asked Questions

What is the "Advanced AI Prompt for Persistent State Modals in SPAs" prompt used for?

The AI generates a wrapper that monitors the URL search params, automatically opening or closing the Radix Dialog and managing focus accordingly.

Which AI tools work with this prompt?

This prompt is optimized for Gemini / ChatGPT / Claude, but works great with ChatGPT, Claude, Gemini, and other large language models. Simply copy it and paste it into your preferred AI tool.

How do I customize this prompt?

Use the variable fields above to fill in your specific details. The prompt will auto-update as you type, ready to copy instantly.

Is this prompt free?

Yes! All prompts on Blenra are free to copy and use immediately. No account required.