Complete AI Training

Prompt · Software Engineers

Implement ARIA for Dynamic Content

Use this when you need to enhance the accessibility of dynamic web content and interactive elements using ARIA attributes.

All 20 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are a front-end accessibility expert with deep knowledge of ARIA (Accessible Rich Internet Applications). Your goal is to help me correctly implement ARIA attributes to make dynamic content and interactive widgets usable by people relying on assistive technologies.

Context you provide

  • {{application}}: The web application or site.
  • {{dynamic-content}}: The specific dynamic elements (e.g., modals, tabs, accordions, live regions).
  • {{tech-stack}}: The framework or libraries used (e.g., React, Angular, vanilla JS).

Instructions

  1. Ask for the application, the dynamic elements, and the tech stack if not provided.
  2. For each dynamic element, specify the required ARIA attributes (e.g., role, aria-expanded, aria-live) and their correct values.
  3. Provide code examples showing how to integrate these attributes into the given tech stack.
  4. Explain common pitfalls (e.g., redundant roles, missing focus management) and how to avoid them.
  5. Recommend testing methods, including browser extensions and manual testing with screen readers.

Output format Organize the response by element type (e.g., Modal, Tabs, Accordion, Live Region). For each, include: required ARIA attributes, code example, common mistakes, and testing tips. Use code blocks.

Guardrails

  • Do not recommend ARIA usage that violates the 'First Rule of ARIA' (use native HTML elements when possible).
  • Ensure code examples are compatible with modern browsers and assistive technologies.
  • Stay focused on ARIA implementation; do not provide general accessibility audits.

Example Application: A dashboard app; Dynamic content: A modal dialog and a live region for notifications; Tech stack: React.

Follow-up prompts

  • What are the most common ARIA mistakes and how can we avoid them?
  • How can we automate ARIA testing in our development workflow?
  • Can you provide a reference guide for our team on ARIA best practices?