# vtex-apps/store-image architecture

> Architecture diagram of the GitHub repository vtex-apps/store-image, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vtex-apps/store-image
- Repository: https://github.com/vtex-apps/store-image

## Overview

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`](https://github.com/vtex-apps/store-image/blob/master/manifest.json) (App manifest), [`react/ImageList.tsx`](https://github.com/vtex-apps/store-image/blob/master/react/ImageList.tsx) (Image list), [`react/ImageSlider.tsx`](https://github.com/vtex-apps/store-image/blob/master/react/ImageSlider.tsx) (Slider adapter), [`react/ImageListWithoutContext.tsx`](https://github.com/vtex-apps/store-image/blob/master/react/ImageListWithoutContext.tsx) (List render)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["React runtime"]
  node_image_list["Image list<br/>react entry<br/>[ImageList.tsx]"]
  node_image_list_noctx["List render<br/>react component"]
  node_image_slider["Slider adapter<br/>react adapter<br/>[ImageSlider.tsx]"]
  node_image["Image<br/>react component<br/>[Image.tsx]"]
  node_image_types["Image types<br/>ts types<br/>[ImageTypes.ts]"]
  node_image_as_list["List mapper<br/>react module<br/>[imageAsList.tsx]"]
  node_schema["Block schema<br/>react schema<br/>[schema.ts]"]
  node_react_css["Component styles<br/>css<br/>[styles.css]"]
  node_slider_layout["Slider layout<br/>external app"]
end

subgraph group_store["Store metadata"]
  node_store_interfaces["Interfaces<br/>store metadata<br/>[interfaces.json]"]
  node_content_schemas["Content schemas<br/>store metadata"]
end

subgraph group_support["Support files"]
  node_manifest["App manifest<br/>vt-ex app boundary<br/>[manifest.json]"]
  node_pkg_root["Root package<br/>repo metadata<br/>[package.json]"]
  node_messages_context["Message keys<br/>i18n base<br/>[context.json]"]
  node_messages_locales["Locale bundles<br/>i18n translations<br/>[en.json]"]
  node_docs_readme["README<br/>docs<br/>[README.md]"]
end

node_manifest -->|"registers"| node_image_list
node_manifest -->|"declares"| node_store_interfaces
node_manifest -->|"declares"| node_content_schemas
node_manifest -->|"localizes"| node_messages_context
node_image_list -->|"delegates"| node_image_list_noctx
node_image_list -->|"uses"| node_schema
node_image_list_noctx -->|"composes"| node_image_slider
node_image_list_noctx -->|"maps"| node_image_as_list
node_image_slider -->|"hands off to"| node_slider_layout
node_image_slider -->|"renders"| node_image
node_image_as_list -->|"depends on"| node_image_types
node_image -->|"typed by"| node_image_types
node_schema -->|"aligns with"| node_content_schemas
node_schema -->|"exposed by"| node_store_interfaces
node_messages_context -->|"translated in"| node_messages_locales
node_docs_readme -->|"documents"| node_image_list
node_react_css -->|"styles"| node_image
node_react_css -->|"styles"| node_image_slider
node_pkg_root -->|"packages"| node_manifest

click node_manifest "https://github.com/vtex-apps/store-image/blob/master/manifest.json"
click node_pkg_root "https://github.com/vtex-apps/store-image/blob/master/package.json"
click node_image_list "https://github.com/vtex-apps/store-image/blob/master/react/ImageList.tsx"
click node_image_list_noctx "https://github.com/vtex-apps/store-image/blob/master/react/ImageListWithoutContext.tsx"
click node_image_slider "https://github.com/vtex-apps/store-image/blob/master/react/ImageSlider.tsx"
click node_image "https://github.com/vtex-apps/store-image/blob/master/react/Image.tsx"
click node_image_types "https://github.com/vtex-apps/store-image/blob/master/react/ImageTypes.ts"
click node_image_as_list "https://github.com/vtex-apps/store-image/blob/master/react/modules/imageAsList.tsx"
click node_schema "https://github.com/vtex-apps/store-image/blob/master/react/modules/schema.ts"
click node_react_css "https://github.com/vtex-apps/store-image/blob/master/react/styles.css"
click node_store_interfaces "https://github.com/vtex-apps/store-image/blob/master/store/interfaces.json"
click node_content_schemas "https://github.com/vtex-apps/store-image/blob/master/store/contentSchemas.json"
click node_messages_context "https://github.com/vtex-apps/store-image/blob/master/messages/context.json"
click node_messages_locales "https://github.com/vtex-apps/store-image/blob/master/messages/en.json"
click node_docs_readme "https://github.com/vtex-apps/store-image/blob/master/docs/README.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_image_list,node_image_list_noctx,node_image_slider,node_image,node_image_types,node_image_as_list,node_schema,node_react_css,node_slider_layout toneBlue
class node_store_interfaces,node_content_schemas toneAmber
class node_manifest,node_pkg_root,node_messages_context,node_messages_locales,node_docs_readme toneMint
```

## Components

### React runtime

Rendering, data shaping, and image components.

- [Image list](https://github.com/vtex-apps/store-image/blob/master/react/ImageList.tsx): react entry · Context-aware entry point for the image list block. · `react/ImageList.tsx`
- [List render](https://github.com/vtex-apps/store-image/blob/master/react/ImageListWithoutContext.tsx): react component · Renders the image list without VTEX list-context wiring. · `react/ImageListWithoutContext.tsx`
- [Slider adapter](https://github.com/vtex-apps/store-image/blob/master/react/ImageSlider.tsx): react adapter · Adapts image items to the downstream slider layout block. · `react/ImageSlider.tsx`
- [Image](https://github.com/vtex-apps/store-image/blob/master/react/Image.tsx): react component · Renders an individual image, link, and loading behavior. · `react/Image.tsx`
- [Image types](https://github.com/vtex-apps/store-image/blob/master/react/ImageTypes.ts): ts types · Shared prop and link shapes for images and list items. · `react/ImageTypes.ts`
- [List mapper](https://github.com/vtex-apps/store-image/blob/master/react/modules/imageAsList.tsx): react module · Transforms image data into the list shape expected by rendering. · `react/modules/imageAsList.tsx`
- [Block schema](https://github.com/vtex-apps/store-image/blob/master/react/modules/schema.ts): react schema · Defines the block/editor contract for image list configuration. · `react/modules/schema.ts`
- [Component styles](https://github.com/vtex-apps/store-image/blob/master/react/styles.css): css · Local styling for the image rendering stack. · `react/styles.css`
- **Slider layout**: external app · External VTEX app that owns carousel behavior and presentation.

### Store metadata

VTEX block interfaces and editor schemas.

- [Interfaces](https://github.com/vtex-apps/store-image/blob/master/store/interfaces.json): store metadata · VTEX block/interface definitions for Site Editor and theme wiring. · `store/interfaces.json`
- [Content schemas](https://github.com/vtex-apps/store-image/blob/master/store/contentSchemas.json): store metadata · Declares the editable fields and configuration surface for the block. · `store/contentSchemas.json`

### Support files

Localization and repository-level package boundary.

- [App manifest](https://github.com/vtex-apps/store-image/blob/master/manifest.json): vt-ex app boundary · Declares the VTEX IO app and its deployment/package boundary. · `manifest.json`
- [Root package](https://github.com/vtex-apps/store-image/blob/master/package.json): repo metadata · Repository-level scripts and workspace settings for development and release. · `package.json`
- [Message keys](https://github.com/vtex-apps/store-image/blob/master/messages/context.json): i18n base · Shared localization keys used by the block and editor labels. · `messages/context.json`
- [Locale bundles](https://github.com/vtex-apps/store-image/blob/master/messages/en.json): i18n translations · Translated labels and descriptions for supported locales. · `messages/en.json`
- [README](https://github.com/vtex-apps/store-image/blob/master/docs/README.md): docs · Usage and integration guidance for the app and theme authors. · `docs/README.md`

## Connections

- 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.
