Implements media and file management components including file upload (drag-drop, multi-file, resumable), image galleries (lightbox, carousel, masonry), video players (custom controls, captions, adaptive streaming), audio players (waveform, playlists), document viewers (PDF, Office), and optimization strategies (compression, responsive images, lazy loading, CDN). Use when handling files, displaying media, or building rich content experiences.
npx skills add https://github.com/ancoleman/ai-design-components --skill managing-media
This skill provides systematic patterns for implementing media and file management components across all formats (images, videos, audio, documents). It covers upload workflows, display patterns, player controls, optimization strategies, and accessibility requirements to ensure performant, accessible, and user-friendly media experiences.
Activate this skill when:
Select implementation based on media type and requirements:
Images → Gallery pattern + lazy loading + responsive srcset
Videos → Player with controls + captions + adaptive streaming
Audio → Player with waveform + playlist support
Documents (PDF) → Viewer with navigation + search + download
File Upload (<10MB) → Basic drag-drop with preview
File Upload (>10MB) → Chunked upload with progress + resume
Multiple Files → Queue management + parallel uploads
For detailed selection criteria, reference references/implementation-guide.md.
For small files with simple requirements:
references/upload-patterns.mdExample: examples/basic-upload.tsx
For large files requiring reliability:
references/advanced-upload.mdExample: examples/chunked-upload.tsx
For image files with editing requirements:
references/image-upload.mdExample: examples/image-upload-crop.tsx
For collections of images:
references/gallery-patterns.mdExample: examples/image-gallery.tsx
For sequential image display:
references/carousel-patterns.mdExample: examples/carousel.tsx
Essential optimization strategies:
srcset and sizesreferences/image-optimization.mdFor custom video playback:
references/video-player.mdExample: examples/video-player.tsx
Performance strategies for video:
metadata, auto, none)references/video-optimization.mdFor audio playback:
references/audio-player.mdExample: examples/audio-player.tsx
For PDF document display:
references/pdf-viewer.mdExample: examples/pdf-viewer.tsx
For DOCX, XLSX, PPTX files:
references/office-viewer.mdValidate client-side before upload:
# Generate optimized image set
python scripts/optimize_images.py --input image.jpg --formats webp,jpg,avif
Strategies:
srcset for device targetingReference references/performance-optimization.md for complete guide.
Strategies:
Essential patterns:
alt="") for decorative images<figure> and <figcaption> for contextreferences/accessibility-images.mdEssential patterns:
references/accessibility-video.mdEssential patterns:
references/accessibility-audio.mdTo validate accessibility:
node scripts/validate_media_accessibility.js
For complete requirements, reference references/accessibility-patterns.md.
Best for feature-complete galleries:
npm install react-image-gallery
See examples/gallery-react-image.tsx for implementation.
Reference /xiaolin/react-image-gallery for documentation.
Alternative: LightGallery (more features, larger bundle)
Best for custom video players:
npm install video.js
See examples/video-js-player.tsx for implementation.
Best for waveform visualization:
npm install wavesurfer.js
See examples/audio-waveform.tsx for implementation.
Best for PDF rendering in React:
npm install react-pdf
See examples/pdf-react.tsx for implementation.
For detailed comparison, reference references/library-comparison.md.
All media components use the design-tokens skill for theming:
Supports light, dark, high-contrast, and custom themes.
Reference the design-tokens skill for theme switching.
Example token usage:
.upload-zone {
border: var(--upload-zone-border);
background: var(--upload-zone-bg);
padding: var(--upload-zone-padding);
border-radius: var(--upload-zone-border-radius);
}
.image-gallery {
gap: var(--gallery-gap);
}
.video-player {
background: var(--video-player-bg);
border-radius: var(--video-border-radius);
}
Four responsive approaches:
See examples/responsive-gallery.tsx for implementations.
Responsive considerations:
Reference references/responsive-media.md for patterns.
For AWS S3, Cloudinary, etc.:
Benefits:
See examples/s3-direct-upload.tsx for implementation.
Reference references/cloud-storage.md for setup.
Generate mock media:
# Generate test images
python scripts/generate_mock_images.py --count 50 --sizes thumb,medium,large
# Generate test video metadata
python scripts/generate_video_metadata.py --duration 300
Validate media accessibility:
node scripts/validate_media_accessibility.js
Analyze performance:
node scripts/analyze_media_performance.js --files images/*.jpg
Start with the example matching the requirements:
basic-upload.tsx # Simple drag-drop upload
chunked-upload.tsx # Large file upload with resume
image-upload-crop.tsx # Image upload with cropping
image-gallery.tsx # Grid gallery with lightbox
carousel.tsx # Image carousel/slider
video-player.tsx # Custom video player
audio-player.tsx # Audio player with controls
audio-waveform.tsx # Audio with waveform visualization
pdf-viewer.tsx # PDF document viewer
s3-direct-upload.tsx # Direct upload to S3
responsive-gallery.tsx # Responsive image gallery patterns
scripts/optimize_images.py - Batch image optimizationscripts/generate_mock_images.py - Test image generationscripts/validate_media_accessibility.js - Accessibility validationscripts/analyze_media_performance.js - Performance analysisreferences/upload-patterns.md - File upload implementationsreferences/gallery-patterns.md - Image gallery designsreferences/video-player.md - Video player featuresreferences/audio-player.md - Audio player patternsreferences/pdf-viewer.md - Document viewer setupreferences/accessibility-patterns.md - Media accessibilityreferences/performance-optimization.md - Optimization strategiesreferences/cloud-storage.md - Cloud integration guidesreferences/library-comparison.md - Library analysisexamples/ directory for working implementationsassets/upload-config.json - Upload constraints and settingsassets/media-templates/ - Placeholder images and iconsThis skill works with other component skills:
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.
Publish Markdown articles to X (Twitter) Articles editor with proper formatting. Use when user wants to publish a Markdown file/URL to X Articles, or mentions "publish to X", "post article to Twitter", "X article", or wants help with X Premium article publishing. Handles cover image upload and converts Markdown to rich text automatically.
AI-powered PPT generation with document analysis and styled images
Self-hosted, open-source alternative to Google NotebookLM for AI-powered research and document analysis. Use when organizing research materials into notebooks, ingesting diverse content sources (PDFs, videos, audio, web pages, Office documents), generating AI-powered notes and summaries, creating multi-speaker podcasts from research, chatting with documents using context-aware AI, searching across materials with full-text and vector search, or running custom content transformations. Supports 16+ AI providers including OpenAI, Anthropic, Google, Ollama, Groq, and Mistral with complete data privacy through self-hosting.
Cell (Cell Press) figure preparation: resolution (300-1000 DPI), formats (TIFF/PDF), RGB color, Avenir/Arial fonts, uppercase panel labels, strict image manipulation policies.
Self-hosted, open-source alternative to Google NotebookLM for AI-powered research and document analysis. Use when organizing research materials into notebooks, ingesting diverse content sources (PDFs, videos, audio, web pages, Office documents), generating AI-powered notes and summaries, creating multi-speaker podcasts from research, chatting with documents using context-aware AI, searching across materials with full-text and vector search, or running custom content transformations. Supports 16+ AI providers including OpenAI, Anthropic, Google, Ollama, Groq, and Mistral with complete data privacy through self-hosting.
Use when creating, editing, formatting, exporting, or extracting LibreOffice Writer (.odt) documents via UNO, including session-based edits, structured text targets, tables, images, lists, patch workflows, and snapshots.
Publish Markdown articles to X (Twitter) Articles editor with proper formatting. Use when user wants to publish a Markdown file/URL to X Articles, or mentions "publish to X", "post article to Twitter", "X article", or wants help with X Premium article publishing. Handles cover image upload and converts Markdown to rich text automatically.
Take ancoleman/managing-media from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npm.
Without those the skill loads but fails at the first command.