How vtex-apps/store-image works
1. Purpose and scope
This is a VTEX IO app, vtex.store-image, whose main job is to export the list-context.image-list block for Store Framework themes. It is not a standalone app; it plugs image content into a theme and hands presentation off to the theme’s slider-layout child block.
2. Top-level architecture
The repo is split into three clear areas: react/ for runtime rendering, store/ for VTEX block/interface metadata, and messages/ for localization. The root manifest.json defines the app as a VTEX package and is the deployment boundary for the platform.
3. Configuration and editor integration
The store/contentSchemas.json and store/interfaces.json files define how the block appears in Site Editor and how theme authors configure it. The README indicates that image lists are authored in theme JSON and can be managed through Admin Site Editor, so this repo’s configuration surface is intentionally declarative.
4. Primary data flow
The main input is an images array passed into list-context.image-list. Each entry carries image URL, mobile image URL, description, link metadata, sizing, loading hints, and optional analytics/promotion fields. That data is then transformed into renderable list items and passed downstream to the slider/layout layer.
5. Context and composition model
The block uses a list-context pattern: list-context.image-list provides image data, and a child slider-layout block determines how those images are displayed. This means the app’s responsibility is data shaping and image rendering, while slide navigation, pagination, and responsive carousel behavior live in the external vtex.slider-layout app.
6. React runtime components
The react/ folder contains the rendering stack. ImageList.tsx and ImageListWithoutContext.tsx suggest two layers: one that integrates with VTEX context/block wiring and one that performs the actual list rendering. ImageSlider.tsx likely adapts the image list into a slider-friendly structure, while Image.tsx renders each individual image element.
7. Data model and feature flags
ImageTypes.ts centralizes the prop shapes for image entries and link objects. Key behavior switches are preload, height, experimentalSetExplicitDimensions, and experimentalPreventLayoutShift, which affect image loading priority and layout stability. The design shows a focus on performance and avoiding cumulative layout shift.
8. Linking, analytics, and commerce metadata
Individual images can be clickable via a link object, and can optionally carry analytics/promotion metadata such as promotion ID, name, position, and product identity. That indicates the image block is not just decorative; it participates in tracking and campaign attribution when used in commerce pages.
9. Styling and customization boundaries
react/styles.css contains the component styling, but the README notes there are no dedicated CSS handles for the block itself. Customization is largely inherited from vtex.slider-layout, so visual control is split between this app’s image rendering and the external slider app’s CSS namespaces.
10. Localization and editor labels
The messages/ directory contains translations for multiple locales, plus context.json for shared text keys. This supports Admin/Site Editor labels and descriptions across languages, which matters because the block is configured declaratively by theme authors.
11. Testing and maintenance tooling
The repo includes a React test suite under react/__tests__, plus standard linting/formatting and TypeScript configuration. GitHub workflows and VTEX CI files indicate the package is validated in CI before release, which is important for a block library used by storefront themes.
12. External dependencies and architectural boundary
The key external dependency is vtex.slider-layout, which owns the carousel behavior, while this repo owns image content rendering and configuration. Images themselves are typically remote assets, often CDN-hosted, so runtime behavior is heavily shaped by network loading, image dimensions, and loading strategy rather than by local data storage.
Main entry points: manifest.json App manifest · ImageList.tsx Image list · ImageSlider.tsx Slider adapter · ImageListWithoutContext.tsx List render
Components 16
React runtime
Rendering, data shaping, and image components.
- Image list · Context-aware entry point for the image list block.
react/ImageList.tsx - List render · Renders the image list without VTEX list-context wiring.
react/ImageListWithoutContext.tsx - Slider adapter · Adapts image items to the downstream slider layout block.
react/ImageSlider.tsx - Image · Renders an individual image, link, and loading behavior.
react/Image.tsx - Image types · Shared prop and link shapes for images and list items.
react/ImageTypes.ts - List mapper · Transforms image data into the list shape expected by rendering.
react/modules/imageAsList.tsx - Block schema · Defines the block/editor contract for image list configuration.
react/modules/schema.ts - Component styles · Local styling for the image rendering stack.
react/styles.css - Slider layout · External VTEX app that owns carousel behavior and presentation.
Store metadata
VTEX block interfaces and editor schemas.
- Interfaces · VTEX block/interface definitions for Site Editor and theme wiring.
store/interfaces.json - Content schemas · Declares the editable fields and configuration surface for the block.
store/contentSchemas.json
Support files
Localization and repository-level package boundary.
- App manifest · Declares the VTEX IO app and its deployment/package boundary.
manifest.json - Root package · Repository-level scripts and workspace settings for development and release.
package.json - Message keys · Shared localization keys used by the block and editor labels.
messages/context.json - Locale bundles · Translated labels and descriptions for supported locales.
messages/en.json - README · Usage and integration guidance for the app and theme authors.
docs/README.md
Connections 19
- App manifest → Image list: registers · The VTEX app exposes the image list block implementation.
- App manifest → Interfaces: declares · The manifest boundary is paired with the block interface metadata.
- App manifest → Content schemas: declares · The app publishes its editable configuration schema.
- App manifest → Message keys: localizes · The app bundles shared message keys for editor/runtime text.
- Image list → List render: delegates · The context-aware entry delegates rendering to the pure list component.
- Image list → Block schema: uses · The entry point is driven by the block schema contract.
- List render → Slider adapter: composes · The list renderer forwards items to the slider adapter.
- List render → List mapper: maps · Input image data is normalized into list items for rendering.
- Slider adapter → Slider layout: hands off to · Carousel layout and navigation are owned by the external slider app.
- Slider adapter → Image: renders · Each slide is rendered as an image element.
- List mapper → Image types: depends on · The mapper uses the shared image and link type shapes.
- Image → Image types: typed by · The image component consumes the shared image prop model.
- Block schema → Content schemas: aligns with · Editor/runtime schema mirrors the Store content schema surface.
- Block schema → Interfaces: exposed by · The block schema is surfaced through VTEX interface metadata.
- Message keys → Locale bundles: translated in · Base message keys are realized in locale-specific bundles.
- README → Image list: documents · The README explains how theme authors use the block.
- Component styles → Image: styles · Local CSS supports the image rendering component.
- Component styles → Slider adapter: styles · Component styling also supports the slider-facing wrapper.
- Root package → App manifest: packages · Repository packaging and release setup sit above the VTEX manifest.