The current hero image strategy relies primarily on CSS background images and can be optimised further. It also does not provide a standard responsive image approach for mobile, desktop, and large displays.
This ticket is to update the vf-hero component to support responsive hero image delivery and better performance by rendering a discoverable image in initial HTML and exposing consistent image APIs across Nunjucks, React, and Angular.
Scope:
- Add responsive image support using picture and img for vf-hero.
- Ensure LCP optimisation defaults:
- fetchpriority set to high
- loading set to eager
- explicit width and height defaults for layout stability
- Add support for responsive sources:
- mobile image source
- desktop/default image source
- large/high-resolution image source
- optional sizes and alt text
- Keep backward compatibility with existing background-image behaviour.
- Update React and Angular implementations to match Nunjucks behavior.
- Update component config examples and README documentation.
- Add/adjust unit tests for React and Angular responsive media behaviour.
Recommended image dimensions:
- Mobile: 360 x 200
- Desktop: 1920 x 1080
- Large/high-res: 2560 x 1440
Acceptance criteria:
- vf-hero can render responsive hero images.
- Hero image request is present in initial document HTML (not CSS-only).
- Default hero image attributes include:
- fetchpriority high
- loading eager
- width 1920
- height 1080
- React and Angular wrappers accept and render the same responsive image inputs as Nunjucks.
- Existing vf_hero_image and vf_hero_image_size behavior remains functional.
- Documentation includes usage examples for responsive image fields and recommended dimensions.
The current hero image strategy relies primarily on CSS background images and can be optimised further. It also does not provide a standard responsive image approach for mobile, desktop, and large displays.
This ticket is to update the vf-hero component to support responsive hero image delivery and better performance by rendering a discoverable image in initial HTML and exposing consistent image APIs across Nunjucks, React, and Angular.
Scope:
Recommended image dimensions:
Acceptance criteria: