APG Patterns
日本語 GitHub
日本語 GitHub

Guide

How to use APG Patterns Examples for building accessible components.

Using with AI Code Assistants

Each pattern includes an AI-friendly definition file (llm.md) that can be used as context when implementing similar components with AI coding assistants like Claude, Cursor, or GitHub Copilot.

What's included in llm.md

  • ARIA roles, properties, and states requirements
  • Keyboard interaction specifications
  • Focus management rules
  • Test checklist for verification
  • Example test code snippets

How to use

1. Copy & paste into prompt

Copy the content and include it in your prompt when asking AI to implement a component.

Implement a Tabs component in Angular following this specification:

[paste llm.md content here]

2. Add to project context

For Claude Code or Cursor, place definition files in your project for automatic context.

my-project/
├── .ai/
│   └── apg-patterns/
│       ├── tabs.md
│       ├── dialog.md
│       └── accordion.md
└── src/

3. Use for test generation

The test checklist helps AI generate comprehensive accessibility tests.

Generate Jest tests for my Tabs component based on this checklist:

## Test Checklist
- [ ] ArrowRight moves to next tab
- [ ] Selected tab has aria-selected="true"
- [ ] Only selected tab has tabIndex="0"

Available Patterns

The following patterns have AI-friendly definition files:

Direct Links to llm.md

Copy these URLs directly or fetch them with AI tools:

Contributing

Help us add more AI-friendly definitions! Visit our GitHub repository to contribute.