contextual-placeholders
Skill0 starsChanged 10 months agoMITView on GitHub
Automatically use contextual placeholder images from Unsplash, Picsum, and other services instead of solid color boxes when building UI components with images
In this repository2 other files it gives its agents.
- solana-devSkill
- solana-mobile-devSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 9 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
When building UI components that display images, always use real placeholder image services instead of solid color boxes or non-existent …
- Very specific: line 15
Always use HTTPS: - All placeholder URLs must use https://
- Very specific: line 34
Explicit user context: - If the user says "travel blog hero", use ?travel,landscape
- Distinctive: line 41
Use appropriate dimensions for the component type:
- Distinctive: line 52
Use source images large enough to scale down gracefully.
- Distinctive: line 56
When multiple similar images appear on the same page, make each unique:
- Very specific: line 58
Picsum: Add ?random=N - https://picsum.photos/400/300?random=1, ?random=2, etc.
- Very specific: line 59
Unsplash: Add &sig=N - https://source.unsplash.com/400x300/?nature&sig=1, &sig=2, etc.
- Very specific: line 60
Pravatar: Use different numbers - https://i.pravatar.cc/150?img=1, ?img=2, etc.
- Very specific: line 61
DiceBear: Use different seeds - ?seed=alice, ?seed=bob, or use actual names if available
- Distinctive: line 74
Leave these unchanged—they are not image placeholders:
- Distinctive: line 77
Icons: - Use icon libraries (Lucide, Heroicons, etc.), not photos
- Distinctive: line 78
Logos: - Add a comment noting "replace with logo" rather than using a random image
- Distinctive: line 79
Charts/graphs: - Use charting libraries or placeholder components
- Distinctive: line 80
Maps: - Use actual map embeds (Google Maps, Mapbox), not photos of maps
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Contextual Placeholders
When building UI components that display images, always use real placeholder image services instead of solid color boxes or non-existent local paths.
Core Rules
- Never use solid color boxes as image placeholders - No
bg-gray-200,bg-slate-300,bg-blue-500, or any solid color div where an image should be - Never use fake local paths - No
/images/placeholder.jpgor./assets/hero.pngthat don't exist - Never use text-based placeholders - No
placeholder.comorplacehold.it - Always use HTTPS - All placeholder URLs must use
https://
Service Selection
Choose the appropriate service based on what the image represents:
| Use Case | Service | URL Pattern |
| Contextual images (heroes, cards, features) | Unsplash | https://source.unsplash.com/WxH/?keywords |
| Random photos (no context needed) | Lorem Picsum | https://picsum.photos/W/H |
| Realistic avatars | Pravatar | https://i.pravatar.cc/SIZE |
| Realistic avatars (alternative) | RandomUser | https://randomuser.me/api/portraits/men/N.jpg or .../women/N.jpg |
| Illustrated avatars | DiceBear | https://api.dicebear.com/7.x/avataaars/svg?seed=NAME |
| Video placeholders | Pexels | Use Pexels embed or video URL |
Keyword Selection for Unsplash
Infer keywords from context:
- Explicit user context - If the user says "travel blog hero", use
?travel,landscape - Component purpose - A team section implies
?team,office,professional - Project context - A restaurant site implies food-related keywords
- Combine 2-3 keywords -
?coffee,cafe,morningis better than just?coffee
Dimensions Reference
Use appropriate dimensions for the component type:
| Component | Dimensions | Aspect Ratio |
| Hero/banner | 1920x1080 or 1280x720 | 16:9 |
| Card image | 400x300 or 600x400 | 4:3 |
| Feature image | 800x600 | 4:3 |
| Thumbnail | 200x150 or 150x150 | 4:3 or 1:1 |
| Avatar | 48, 64, 96, or 150 | 1:1 |
| Background | 1920x1080 | 16:9 |
Use source images large enough to scale down gracefully. A 1280x720 image works at any smaller viewport.
Uniqueness
When multiple similar images appear on the same page, make each unique:
- Picsum: Add
?random=N-https://picsum.photos/400/300?random=1,?random=2, etc. - Unsplash: Add
&sig=N-https://source.unsplash.com/400x300/?nature&sig=1,&sig=2, etc. - Pravatar: Use different numbers -
https://i.pravatar.cc/150?img=1,?img=2, etc. - DiceBear: Use different seeds -
?seed=alice,?seed=bob, or use actual names if available
Responsive Display
Placeholder dimensions are fixed in the URL, but CSS handles responsive display. Recommend using:
object-fit: cover(or Tailwind'sobject-cover) to fill containers without distortionwidth: 100%ormax-width: 100%for fluid scaling
The placeholder image dimensions don't need to match every breakpoint—CSS handles the presentation.
What This Skill Does NOT Cover
Leave these unchanged—they are not image placeholders:
- Skeleton loaders - Animated placeholder boxes for loading states are intentional UI
- Icons - Use icon libraries (Lucide, Heroicons, etc.), not photos
- Logos - Add a comment noting "replace with logo" rather than using a random image
- Charts/graphs - Use charting libraries or placeholder components
- Maps - Use actual map embeds (Google Maps, Mapbox), not photos of maps
- Intentional design blocks - Solid color sections that are part of the design, not placeholders
Examples
Hero section for a travel blog:
<img
src="https://source.unsplash.com/1920x1080/?travel,adventure,landscape"
alt="Travel destination"
class="w-full h-96 object-cover"
/>Team member cards (4 people):
<img src="https://i.pravatar.cc/150?img=1" alt="Team member" class="rounded-full" />
<img src="https://i.pravatar.cc/150?img=2" alt="Team member" class="rounded-full" />
<img src="https://i.pravatar.cc/150?img=3" alt="Team member" class="rounded-full" />
<img src="https://i.pravatar.cc/150?img=4" alt="Team member" class="rounded-full" />Product cards for an e-commerce site:
<img src="https://source.unsplash.com/400x300/?sneakers,shoes&sig=1" alt="Product" class="object-cover" />
<img src="https://source.unsplash.com/400x300/?sneakers,shoes&sig=2" alt="Product" class="object-cover" />
<img src="https://source.unsplash.com/400x300/?sneakers,shoes&sig=3" alt="Product" class="object-cover" />Generic card grid (no specific context):
<img src="https://picsum.photos/400/300?random=1" alt="Card image" />
<img src="https://picsum.photos/400/300?random=2" alt="Card image" />
<img src="https://picsum.photos/400/300?random=3" alt="Card image" />Illustrated avatar for a chat app:
<img src="https://api.dicebear.com/7.x/avataaars/svg?seed=johndoe" alt="User avatar" />Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

