How vtex-apps/slider-layout works
Project type and purpose
• Slider Layout is a VTEX IO app that provides a reusable, configurable React UI component (a carousel/slider) for the VTEX Store Framework.
• It does not include a standalone backend service; it ships code (JS, TS, JSON schemas) that is deployed into the VTEX runtime and runs in the browser, integrating with VTEX’s block editor and Google Analytics 4 (GA4).
File structure
• Top‐level metadata and configuration:
• manifest.json – declares the app, its blocks (slider-layout, slider-layout-group), and dependencies.
• store/ (contentSchemas.json, interfaces.json) – defines the schema of block props for the VTEX Site Editor.
• messages/ – JSON files for i18n (block labels, descriptions).
• React implementation under react/:
• hooks/ – custom hooks (useAutoplay, useTouchHandlers, useKeyboardArrows, etc.) encapsulating behavior.
• modules/ – utility functions (cssHandles).
• SliderLayout.tsx and SliderLayoutGroup.tsx – entry points for each block.
• fixtures, mocks, tests – unit tests for components and hooks.
• CI/CD and QA:
• .github/workflows – pull-request checks.
• ESLint, Prettier, TypeScript configs.
• CHANGELOG.md, crowdin.yml for translations.
README for additional insights
• Describes two blocks: slider-layout (renders a carousel given children) and slider-layout-group (syncs multiple sliders).
• Explains GA4 integration via a view_promotion event.
• Shows prop types, CSS handles, advanced configuration, and customization guide.