Overview
The enhanced square banners component displays a responsive grid of clickable banner images with optional overlay text. It’s perfect for showcasing categories, promotions, or featured content in an organized grid layout.Images are cropped from the edges to fit different screen sizes. When designing, consider the parts that will be cropped horizontally and vertically to ensure important content remains visible.
Location
Component path
Configuration
Intwilight.json, this component is identified by key b89edc4a-ce0b-468f-8323-2da48147bb32.
Available fields
Collection of banner images (min: 1, max: 5)
Banner image URL. Recommended size: 640×427 pixels
Link destination when the banner is clicked
Main heading text displayed on the image with large, bold font
Additional descriptive text displayed below the title with smaller font
Usage example
Template structure
Grid behavior
The grid layout adapts based on the number of banners:1-3 banners
- Each banner gets an equal column
- Taller height with
h-lg-bannerclass
4-5 banners
- Three columns grid
- Multiple rows with
two-rowclass - Standard height with
h-bannerclass
Link types
Theurl field supports these link sources:
- products: Link to a specific product
- categories: Link to a product category
- brands: Link to a brand page
- pages: Link to a custom page
- blog_articles: Link to a blog article
- blog_categories: Link to a blog category
- offers_link: Link to the offers page
- brands_link: Link to all brands
- blog_link: Link to the blog
- custom: Custom external URL
Overlay behavior
Overlay is conditionally applied:- When a title exists:
has-overlayclass adds a dark overlay for text readability - Without title: No overlay, showing the image in its natural state
Lazy loading
Banners use lazy loading:lazy class and data-bg attribute enable deferred image loading for better performance.
Accessibility
- Uses banner title as aria-label when available
- Falls back to “square-banner-” for banners without titles
- Properly escapes HTML attributes
Styling
The component uses these main CSS classes:.s-block--banners: Main container styling.banner-entry: Individual banner styling.has-overlay: Adds dark overlay when text is present.h-lg-banner: Larger height for 1-3 banners.h-banner: Standard height for 4-5 banners.text-with-border: Text styling with border effects
Responsive spacing
- Mobile: 0.75rem gap between banners
- Desktop: 2rem gap between banners
Default example
The component comes with 5 default banners featuring:- Title: “Browse by category”
- Description: “Make shopping easy and access your products”
- Various product images
The banner height automatically adjusts based on the number of banners. Fewer banners (1-3) display taller for more prominent visibility.