Cursor prompt
Add WCAG Accessibility to UI
WCAG 2.1 AA compliance: keyboard navigation, ARIA labels, focus management, color contrast, and screen reader support.
Audit and implement WCAG 2.1 AA accessibility for {{component_or_page}} in {{project_name}}. ### Keyboard Navigation - Tab order must follow visual reading order - All interactive elements reachable by keyboard (no mouse-only interactions) - Custom interactive elements: tabIndex="0", onKeyDown handler for Enter/Space - Modal/dialog: trap focus inside while open, return focus to trigger on close - Add skip navigation: <a href="#main-content" className="sr-only focus:not-sr-only">Skip to content</a> ### ARIA Roles and Labels ```tsx // Icon-only button <button aria-label="Close dialog"><X size={16} /></button> // Form field <label htmlFor="email">Email address</label> <input id="email" aria-describedby="email-error" aria-required="true" /> <p id="email-error" role="alert">{error}</p> // Loading state <div aria-busy="true" aria-label="Loading results">...</div> ``` ### Color Contrast (verify with browser DevTools or axe) - Normal text: 4.5:1 minimum ratio against background - Large text (18px+ or 14px+ bold): 3:1 minimum - UI components and focus indicators: 3:1 minimum - Never rely on color alone: add icons, patterns, or text labels ### Focus Indicators All interactive elements must show a visible focus ring: ```css :focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; } ``` ### Dynamic Content - Route changes: announce new page title to screen readers - Async results: wrap result count in role="status" for polite announcement ### Testing Add axe-core in dev: auto-fail on violations in browser console. ### Output Accessible versions of all components, focus management utilities, axe-core setup.
Fill in: {{component_or_page}}, {{project_name}}. In Loopy you fill these in a form and copy the finished prompt in one click.
More ui design prompts
- CursorAdd Dark Mode with CSS VariablesImplement theme switching with CSS custom properties, localStorage persistence, system preference detection, and flash-free loading.
- v0Analytics DashboardData visualization dashboard with KPI cards, charts, data table, and date range filtering.
- v0Blog LayoutClean blog with featured posts, category filters, reading time, and author profiles.
- CursorBuild Multi-Step Form WizardMulti-step wizard with per-step validation, progress indicator, back/next navigation, and sessionStorage persistence.
- v0Component from DescriptionStructured prompt to generate a polished React component with proper accessibility, responsiveness, and dark mode support.
- v0Component Library ShowcaseDesign system documentation page showing component variants, usage examples, and code snippets.

