Displaying timelines

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

Displaying timelines is an AI agent skill from the GitHub repository ancoleman/ai-design-components. Displays chronological events and activity through timelines, activity feeds, Gantt charts, and calendar interfaces. Use when showing historical events, project schedules, social feeds, notifications, audit logs, or time-based data. Provides implementation patterns for vertical/horizontal timelines,

How to use this skill

Skill file

Displaying Timelines & Activity Components

Purpose

This skill enables systematic creation of timeline and activity components, from simple vertical timelines to complex interactive Gantt charts. It provides clear decision frameworks based on use case and data characteristics, ensuring optimal performance, real-time updates, and accessible implementations.

When to Use

Activate this skill when:

Quick Decision Framework

Select component type based on use case:

Social Activity        → Activity Feed (infinite scroll, reactions)
System Events          → Audit Log (searchable, exportable, precise timestamps)
User Notifications     → Notification Feed (read/unread, grouped by date)
Historical Events      → Vertical Timeline (milestones, alternating sides)
Project Planning       → Gantt Chart (dependencies, drag-to-reschedule)
Scheduling             → Calendar Interface (month/week/day views)
Interactive Roadmap    → Horizontal Timeline (zoom, pan, filter)

For detailed selection criteria, reference references/component-selection.md.

Core Implementation Patterns

Activity Feeds

Social Feed Pattern:

Notification Feed Pattern:

Audit Log Pattern:

Example: examples/social-activity-feed.tsx

Timeline Visualizations

Vertical Timeline:

Horizontal Timeline:

Interactive Timeline:

Example: examples/milestone-timeline.tsx

Gantt Charts

Project Planning Features:

To generate Gantt chart data:

python scripts/generate_gantt_data.py --tasks 50 --dependencies auto

Reference references/gantt-patterns.md for implementation details.

Example: examples/project-gantt.tsx

Calendar Interfaces

Month View:

Week View:

Day/Agenda View:

Reference references/calendar-patterns.md for all views.

Example: examples/calendar-scheduler.tsx

Timestamp Formatting

Essential timestamp patterns:

Relative (Recent Events):

Absolute (Older Events):

Implementation Considerations:

To format timestamps consistently:

node scripts/format_timestamps.js --locale en-US --timezone auto

Reference references/timestamp-formatting.md for complete patterns.

Real-Time Updates

Live Activity Feed:

Implementation Pattern:

  1. Show user action immediately
  2. Update timestamp to "Just now"
  3. Send to server in background
  4. Rollback if error occurs

Reference references/real-time-updates.md for WebSocket patterns.

Example: examples/realtime-activity.tsx

Performance Optimization

Critical performance thresholds:

<100 events       → Client-side rendering, no virtualization
100-1,000 events  → Virtual scrolling recommended
1,000+ events     → Virtual scrolling + server pagination
Real-time         → Debounce updates, batch insertions

Optimization Strategies:

To benchmark performance:

node scripts/benchmark_timeline.js --events 10000

Reference references/performance-optimization.md for details.

Accessibility Requirements

Essential WCAG compliance:

Semantic HTML:

ARIA Patterns:

Keyboard Navigation:

Screen Reader Support:

To validate accessibility:

node scripts/validate_timeline_accessibility.js

Reference references/accessibility-patterns.md for complete requirements.

Responsive Design

Three proven strategies:

1. Stack Vertically (Mobile)

2. Simplify Display

3. Horizontal Scroll

Reference references/responsive-strategies.md for implementations.

Example: examples/responsive-timeline.tsx

Library Recommendations

Timeline: react-chrono (Flexible)

Best for timeline visualizations with rich content:

npm install react-chrono

See examples/react-chrono-timeline.tsx for setup.

Alternative: react-vertical-timeline-component

Gantt Charts: SVAR React Gantt

Best for project management:

npm install @svar/gantt

Enterprise Alternative: Bryntum Gantt

Calendar: react-big-calendar

Best for scheduling interfaces:

npm install react-big-calendar

Alternative: FullCalendar

For detailed comparison, reference references/library-comparison.md.

Design Token Integration

Timelines use the design-tokens skill for consistent theming:

Timeline-Specific Tokens:

Standard Token Categories:

Supports light, dark, high-contrast, and custom themes.

Reference the design-tokens skill for theme switching.

Working Examples

Start with the example matching the requirements:

social-activity-feed.tsx       # Social feed with reactions
notification-center.tsx        # Notification system with filters
audit-log-viewer.tsx           # System audit log
milestone-timeline.tsx         # Vertical timeline with milestones
project-gantt.tsx              # Gantt chart with dependencies
calendar-scheduler.tsx         # Full calendar with all views
realtime-activity.tsx          # Live updates via WebSocket
responsive-timeline.tsx        # Mobile-optimized timeline

Testing Tools

Generate mock timeline data:

python scripts/generate_timeline_data.py --events 500 --realtime

Test real-time updates:

node scripts/simulate_realtime.js --rate 5/sec --duration 60s

Validate accessibility:

node scripts/validate_timeline_accessibility.js

Benchmark performance:

node scripts/benchmark_timeline.js --events 10000 --virtual

Next Steps

  1. Identify the timeline use case (activity, events, schedule)
  2. Select the appropriate component type
  3. Choose a library or build custom with tokens
  4. Start with the matching example file
  5. Implement core functionality
  6. Add real-time updates if needed
  7. Test performance with large datasets
  8. Validate accessibility compliance
  9. Apply responsive strategy for mobile
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.