Implementing navigation

From ancoleman/ai-design-components · View interactive version

Implementing navigation is an AI agent skill from the GitHub repository ancoleman/ai-design-components. Implements navigation patterns and routing for both frontend (React/TS) and backend (Python) including menus, tabs, breadcrumbs, client-side routing, and server-side route configuration. Use when building navigation systems or setting up routing.

How to use this skill

Skill file

Navigation Patterns & Routing Implementation

Purpose

This skill provides comprehensive guidance for implementing navigation systems across both frontend and backend applications. It covers client-side navigation patterns (menus, tabs, breadcrumbs) and routing (React Router, Next.js) as well as server-side route configuration (Flask, Django, FastAPI).

When to Use

Use this skill when:

Navigation Decision Framework

Information Architecture → Navigation Pattern

Flat (1-2 levels)      → Top Navigation
Deep (3+ levels)       → Side Navigation
E-commerce/Large       → Mega Menu
Linear Process         → Stepper/Wizard
Long Content          → Table of Contents
Power Users           → Command Palette
Multi-section Page    → Tabs
Large Data Sets       → Pagination

Frontend Navigation Components

Primary Navigation Patterns

Top Navigation (Horizontal)

Side Navigation (Vertical)

Mega Menu

Secondary Navigation Components

Breadcrumbs

Tabs

Pagination

Client-Side Routing

React Router (Industry Standard)

Next.js App Router

Backend Routing Patterns

Python Web Frameworks

Flask

Django

FastAPI

Mobile Navigation

Patterns for Touch Devices

Hamburger Menu

Bottom Navigation

Tab Bar

Accessibility Requirements

Keyboard Navigation

Tab       → Move forward through links
Shift+Tab → Move backward through links
Enter     → Activate link/button
Space     → Activate button
Arrow keys → Navigate within menus
Escape    → Close dropdowns/modals

ARIA Patterns

Essential ARIA attributes for accessible navigation:

Focus Management

Implementation Utilities

Navigation Structure Management

Generate and validate navigation trees:

# Validate navigation structure
node scripts/validate_navigation_tree.js nav-config.json

# Generate breadcrumb trails
node scripts/calculate_breadcrumbs.js current-path

Route Generation (Python)

Generate route configurations:

# Generate Flask/Django/FastAPI routes
python scripts/generate_routes.py --framework flask --config routes.yaml

Code Examples

Frontend Examples

For working navigation implementations:

Backend Examples

For routing configuration:

Navigation Configuration

For complex navigation structures, use the configuration schema:

Validate configurations before implementation using the validation script.

Library Recommendations

Frontend Routing

React Router is the recommended solution for React applications:

Component Libraries

For rapid development, consider:

Progressive Enhancement

Build navigation that works without JavaScript:

Performance Considerations

Testing Navigation

Essential navigation tests:

Next Steps

  1. Analyze the information architecture
  2. Select appropriate navigation pattern
  3. Implement with accessibility first
  4. Add progressive enhancement
  5. Test across devices and assistive technologies

For detailed implementation guides, explore the referenced documentation files based on specific requirements.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.