Skip to content
hyva-themes avatar

Hyva Render Media Image

Responsive image rendering for Hyvä templates using the Media view model's picture element generator.

CCM score
63 of 100
skills.sh installs
1.4K
GitHub stars
86
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers generating <picture> markup via getResponsivePictureHtml() for hero, product, and CMS images
  • Includes a base PHTML template, a pattern table for literal, variable, and mobile/desktop image cases, and a reference file
  • Sets loading strategy: eager loading with high fetchpriority for above-fold LCP images, lazy loading for below-fold
  • Designed for Hyvä Theme developers who need responsive images with breakpoints in PHTML templates

Install

$ npx -y skills add hyva-themes/hyva-ai-tools --skill hyva-render-media-image -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Hyvä Render Image

Generate responsive <picture> elements for Hyvä Theme templates using the \Hyva\Theme\ViewModel\Media view model.

When to Use

  • Adding images to Hyvä PHTML templates
  • Creating responsive images with different sources for mobile/desktop
  • Implementing hero banners, product images, or CMS content images
  • Optimizing images for Core Web Vitals (LCP, CLS)

Workflow

1. Gather Image Requirements

The user may provide image data in one of these ways:

Option A: Direct values - Ask the user for:

  1. Image path(s) - Location in pub/media/ (e.g., wysiwyg/hero.jpg, catalog/product/...)
  2. Image dimensions - Width and height in pixels
  3. Responsive requirements - Different images for mobile vs desktop?
  4. Image purpose - Hero/LCP image (eager loading) or below-fold (lazy loading)?
  5. Alt text - Meaningful description for accessibility

Option B: PHP variable - The user provides a variable name (e.g., $imageData, $heroImage). Inform the user of the required array structure documented in references/rendering-images.md under ## Image Configuration Format.

Details

Repository
github.com/hyva-themes/hyva-ai-tools
Categories
Frontend & UI Code, PHP & Laravel
First seen
Jun 3, 2026

More from hyva-themes/hyva-ai-tools

All 12

Similar to Hyva Render Media Image

More Frontend & UI Code