vtex-io-react-apps

vtex/skills

React-компоненты и блоки store для VTEX IO: интерфейсы, схемы, стили.

Звёзды47
Форки9
Авторvtex
Обновлёнокт 14 2026

Установка

SKILL.md

Frontend React Components & Hooks

When this skill applies

Use this skill when building VTEX IO frontend apps using the react builder — creating React components that integrate with Store Framework as theme blocks, configuring interfaces.json, setting up contentSchemas.json for Site Editor, and applying styling patterns.

  • Creating custom storefront components (product displays, forms, banners)
  • Building admin panel interfaces with VTEX Styleguide
  • Registering components as Store Framework blocks
  • Exposing component props in Site Editor via contentSchemas.json
  • Applying css-handles for safe storefront styling

Do not use this skill for:

  • Backend service implementation (use vtex-io-service-apps instead)
  • GraphQL schema and resolver development (use vtex-io-graphql-api instead)
  • Manifest and builder configuration (use vtex-io-app-structure instead)

Decision rules

  • Every visible storefront element is a block. Blocks are declared in theme JSON and map to React components via interfaces.
  • interfaces.json (in /store) maps block names to React component files: "component" is the file name in /react (without extension), "allowed" lists child blocks, "composition" controls how children work ("children" or "blocks").
  • Each exported component MUST have a root-level file in /react that re-exports it. The builder resolves "component": "ProductReviews" to react/ProductReviews.tsx.
  • For storefront components, use vtex.css-handles for styling (not inline styles, not global CSS).
  • For admin components, use vtex.styleguide — the official VTEX Admin component library. No third-party UI libraries.
  • Use contentSchemas.json in /store to make component props editable in Site Editor (JSON Schema format). Merchant edits are stored by vtex.pages-graphql under a key that includes the declaring app's MAJOR version (vendor.app@MAJOR.x:template). A major version bump on the declaring app makes those edits invisible to the resolver until they are migrated to the new major with the updateThemeIds mutation in vtex.pages-graphql@2.x — see vtex-io-storefront-theme-versioning.
  • Use react-intl and the messages builder for i18n — never hardcode user-facing strings.
  • Fetch data via GraphQL queries (useQuery from react-apollo), never via direct API calls from the browser.

Architecture:

Store Theme (JSON blocks)
  └── declares "product-reviews" block with props
        │
        ▼
interfaces.json → maps "product-reviews" to "ProductReviews" component
        │
        ▼
react/ProductReviews.tsx → React component renders
        │
        ├── useCssHandles() → CSS classes for styling
        ├── useQuery() → GraphQL data fetching
        └── useProduct() / useOrderForm() → Store Framework context hooks

Hard constraints

Constraint: Declare Interfaces for All Storefront Blocks

Every React component that should be usable as a Store Framework block MUST have a corresponding entry in store/interfaces.json. Without the interface declaration, the block cannot be referenced in theme JSON files.

Why this matters

The store builder resolves block names to React components through interfaces.json. If a component has no interface, it is invisible to Store Framework and will not render on the storefront.

Detection

If a React component in /react is intended for storefront use but has no matching entry in store/interfaces.json, warn the developer. The component will compile but never render.

Correct

{
  "product-reviews": {
    "component": "ProductReviews",
    "composition": "children",
    "allowed": ["product-review-item"]
  },
  "product-review-item": {
    "component": "ReviewItem"
  }
}
// react/ProductReviews.tsx
import ProductReviews from './components/ProductReviews'

export default ProductReviews

Wrong

// react/ProductReviews.tsx exists but NO store/interfaces.json entry
// The component compiles fine but cannot be used in any theme.
// Adding <product-reviews /> in a theme JSON will produce:
// "Block 'product-reviews' not found"
import ProductReviews from './components/ProductReviews'

export default ProductReviews

Constraint: Use VTEX Styleguide for Admin UIs

Admin panel components (apps using the admin builder) MUST use VTEX Styleguide (vtex.styleguide) for UI elements. You MUST NOT use third-party UI libraries like Material UI, Chakra UI, or Ant Design in admin apps.

Why this matters

VTEX Admin has a consistent design language enforced by Styleguide. Third-party UI libraries produce inconsistent visuals, may conflict with the Admin's global CSS, and add unnecessary bundle size. Apps submitted to the VTEX App Store with non-Styleguide admin UIs will fail review.

Detection

If you see imports from @material-ui, @chakra-ui/react, @chakra-ui, antd, or @ant-design in an admin app, warn the developer to use vtex.styleguide instead.

Correct

// react/admin/ReviewModeration.tsx
import React, { useState } from 'react'
import {
  Layout,
  PageHeader,
  Table,
  Button,
  Tag,
  Modal,
  Input,
} from 'vtex.styleguide'

interface Review {
  id: string
  author: string
  rating: number
  text: string
  status: 'pending' | 'approved' | 'rejected'
}

function ReviewModeration() {
  const [reviews, setReviews] = useState<Review[]>([])
  const [modalOpen, setModalOpen] = useState(false)

  const tableSchema = {
    properties: {
      author: { title: 'Author', width: 200 },
      rating: { title: 'Rating', width: 100 },
      text: { title: 'Review Text' },
      status: {
        title: 'Status',
        width: 150,
        cellRenderer: ({ cellData }: { cellData: string }) => (
          <Tag type={cellData === 'approved' ? 'success' : 'error'}>
            {cellData}
          </Tag>
        ),
      },
    },
  }

  return (
    <Layout fullWidth pageHeader={<PageHeader title="Review Moderation" />}>
      <Table
        items={reviews}
        schema={tableSchema}
        density="medium"
      />
    </Layout>
  )
}

export default ReviewModeration

Wrong

// react/admin/ReviewModeration.tsx
import React from 'react'
import { DataGrid } from '@material-ui/data-grid'
import { Button } from '@material-ui/core'

// Material UI components will look inconsistent in the VTEX Admin,
// conflict with global styles, and inflate bundle size.
// This app will fail VTEX App Store review.
function ReviewModeration() {
  return (
    <div>
      <DataGrid rows={[]} columns={[]} />
      <Button variant="contained" color="primary">Approve</Button>
    </div>
  )
}

Constraint: Export Components from react/ Root Level

Every Store Framework block component MUST have a root-level export file in the /react directory that matches the component value in interfaces.json. The actual implementation can live in subdirectories, but the root file must exist.

Why this matters

The react builder resolves components by looking for files at the root of /react. If interfaces.json declares "component": "ProductReviews", the builder looks for react/ProductReviews.tsx. Without this root export file, the component will not be found and the block will fail to render.

Detection

If interfaces.json references a component name that does not have a matching file at the root of /react, STOP and create the export file.

Correct

// react/ProductReviews.tsx — root-level export file
import ProductReviews from './components/ProductReviews/index'

export default ProductReviews
// react/components/ProductReviews/index.tsx — actual implementation
import React from 'react'
import { useCssHandles } from 'vtex.css-handles'

const CSS_HANDLES = ['container', 'title', 'list'] as const

interface Props {
  title: string
  maxReviews: number
}

function ProductReviews({ title, maxReviews }: Props) {
  const handles = useCssHandles(CSS_HANDLES)
  return (
    <div className={handles.container}>
      <h2 className={handles.title}>{title}</h2>
      {/* ... */}
    </div>
  )
}

export default ProductReviews

Wrong

react/components/ProductReviews/index.tsx exists but
react/ProductReviews.tsx does NOT exist.
The builder cannot find the component.
Error: "Could not find component ProductReviews"

Preferred pattern

Create the React component inside a subdirectory:

// react/components/ProductReviews/index.tsx
import React, { useMemo } from 'react'
import { useQuery } from 'react-apollo'
import { useProduct } from 'vtex.product-context'
import { useCssHandles } from 'vtex.css-handles'

import GET_REVIEWS from '../../graphql/getReviews.graphql'
import ReviewItem from './ReviewItem'

const CSS_HANDLES = [
  'reviewsContainer',
  'reviewsTitle',
  'reviewsList',
  'averageRating',
  'emptyState',
] as const

interface Props {
  title?: string
  showAverage?: boolean
  maxReviews?: number
}

function ProductReviews({
  title = 'Customer Reviews',
  showAverage = true,
  maxReviews = 10,
}: Props) {
  const handles = useCssHandles(CSS_HANDLES)
  const productContext = useProduct()
  const productId = productContext?.product?.productId

  const { data, loading, error } = useQuery(GET_REVIEWS, {
    variables: { productId, limit: maxReviews },
    skip: !productId,
  })

  const averageRating = useMemo(() => {
    if (!data?.reviews?.length) return 0

    const sum = data.reviews.reduce(
      (acc: number, review: { rating: number }) => acc + review.rating,
      0
    )

    return (sum / data.reviews.length).toFixed(1)
  }, [data])

  if (loading) return <div className={handles.reviewsContainer}>Loading...</div>
  if (error) return null

  return (
    <div className={handles.reviewsContainer}>
      <h2 className={handles.reviewsTitle}>{title}</h2>

      {showAverage && data?.reviews?.length > 0 && (
        <div className={handles.averageRating}>
          Average: {averageRating} / 5
        </div>
      )}

      {data?.reviews?.length === 0 ? (
        <p className={handles.emptyState}>No reviews yet.</p>
      ) : (
        <ul className={handles.reviewsList}>
          {data.reviews.map((review: { id: string; author: string; rating: number; text: string }) => (
            <ReviewItem key={review.id} review={review} />
          ))}
        </ul>
      )}
    </div>
  )
}

export default ProductReviews

Root export file:

// react/ProductReviews.tsx
import ProductReviews from './components/ProductReviews'

export default ProductReviews

Block interface:

{
  "product-reviews": {
    "component": "ProductReviews",
    "composition": "children",
    "allowed": ["product-review-form"],
    "render": "client"
  }
}

Site Editor schema:

{
  "definitions": {
    "ProductReviews": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "title": "Section Title",
          "description": "Title displayed above the reviews list",
          "default": "Customer Reviews"
        },
        "showAverage": {
          "type": "boolean",
          "title": "Show average rating",
          "default": true
        },
        "maxReviews": {
          "type": "number",
          "title": "Maximum reviews",
          "default": 10,
          "enum": [5, 10, 20, 50]
        }
      }
    }
  }
}

Using the component in a Store Framework theme:

{
  "store.product": {
    "children": [
      "product-images",
      "product-name",
      "product-price",
      "buy-button",
      "product-reviews"
    ]
  },
  "product-reviews": {
    "props": {
      "title": "What Our Customers Say",
      "showAverage": true,
      "maxReviews": 20
    }
  }
}

Common failure modes

  • Importing third-party UI libraries for admin apps: Using @material-ui/core, @chakra-ui/react, or antd conflicts with VTEX Admin's global CSS, produces inconsistent visuals, and will fail App Store review. Use vtex.styleguide instead.
  • Directly calling APIs from React components: Using fetch() or axios exposes authentication tokens to the client and bypasses CORS restrictions. Use GraphQL queries that resolve server-side via useQuery from react-apollo.
  • Hardcoded strings without i18n: Components with hardcoded strings only work in one language. Use the messages builder and react-intl for internationalization.
  • Missing root-level export file: If interfaces.json references "component": "ProductReviews" but react/ProductReviews.tsx doesn't exist, the block silently fails to render.
  • Major version bump on a content-holding component app: A vtex release major on an app that ships store/contentSchemas.json makes every Site Editor edit ever saved against blocks declared by that app invisible to the resolver until it is migrated to the new major with the updateThemeIds mutation in vtex.pages-graphql@2.x. Use a patch or minor whenever possible, and follow vtex-io-storefront-theme-versioning when a major is unavoidable.

Review checklist

  • <!-- -->Does every storefront block have a matching entry in store/interfaces.json?
  • <!-- -->Does every interfaces.json component have a root-level export file in /react?
  • <!-- -->Are admin apps using vtex.styleguide (no third-party UI libraries)?
  • <!-- -->Are storefront components using css-handles for styling?
  • <!-- -->Is data fetched via GraphQL (useQuery), not direct API calls?
  • <!-- -->Are user-facing strings using react-intl and the messages builder?
  • <!-- -->Is contentSchemas.json defined for Site Editor-editable props?
  • <!-- -->If the app ships store/contentSchemas.json, has the merchant-facing impact of any planned major version bump been reviewed?

Related skills

  • vtex-io-storefront-theme-versioning — Use when the app ships store/contentSchemas.json and a version change must preserve or migrate Site Editor content.
  • vtex-io-storefront-theme-app — Use when the question is how a consumer theme composes these blocks into pages.

Reference

  • Developing Custom Storefront Components — Guide for building Store Framework components
  • Interfaces — How interfaces map blocks to React components
  • React Builder — React builder configuration and directory structure
  • Making a Custom Component Available in Site Editor — contentSchemas.json and Site Editor integration
  • Store Framework — Overview of the block-based storefront system
  • Using Components — How to use native and custom components in themes
  • VTEX Styleguide — Official component library for VTEX Admin UIs

Вставить в README

Ссылка на карточку для вашего README — без картинок и счётчиков.

[DarkPlay: vtex-io-react-apps](https://darkplay.ru/ai/skills/skills-vtex-io-react-apps)

Похожие скиллы и другие разделы каталога

Похожие скиллы в категории «Фронтенд»

Та же категория — сравните, что ещё подойдёт под вашу задачу.

shadcnshadcn-ui · Управление компонентами и проектами shadcn: добавление, поиск, исправление, отладка…
128 442 ★
angular-developerangular · Генерация кода Angular и архитектурные рекомендации. Используйте при создании проектов…
101 571 ★
zustandlobehub · Соглашения Zustand-стора LobeHub: слайсы, действия, селекторы, оптимистичные обновления.
85 733 ★
frontend-designanthropics · Руководство по выразительному, осмысленному визуальному дизайну при создании или…
47 601 ★
daisyuisaadeghi · Официальный навык daisyUI — UI-библиотеки для Tailwind CSS.
42 888 ★
chakra-ui-builderchakra-ui · Адаптивные доступные UI-компоненты и темы на Chakra UI v3: токены, семантические токены…
40 736 ★
clone-websitejcodesmore · Реверс-инжиниринг и клонирование сайтов за один проход: извлекает ресурсы, CSS и контент…
39 406 ★
vercel-react-best-practicesvercel-labs · Рекомендации Vercel Engineering по оптимизации производительности React и Next.js…
34 413 ★
heroui-reactheroui-inc · Библиотека HeroUI v3 для React (Tailwind v4 + React Aria): компоненты, темы, установка.
31 248 ★
react-best-practicesmastra-ai · Рекомендации Mastra по оптимизации производительности React: паттерны, загрузка данных…
29 588 ★
Популярное в разделе «Скиллы»

Самые востребованные скиллов раздела по установкам и звёздам.

find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
4 400 000 устан.
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
1 600 000 устан.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
1 600 000 устан.
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
1 600 000 устан.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
1 600 000 устан.
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
1 500 000 устан.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
1 400 000 устан.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
1 300 000 устан.
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
1 300 000 устан.
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.
1 300 000 устан.
Похожее в других разделах каталога

Соседние разделы каталога: возможно, нужный инструмент живёт там.

React Build Resolveraffaan-m · Чинит сборки React в Vite, webpack, Next.js и других: JSX, гидратация, типы.
225 587 ★
React Revieweraffaan-m · Ревьюер React/JSX: хуки, производительность, границы компонентов и безопасность.
225 587 ★
Vue Revieweraffaan-m · Ревьюер Vue.js: Composition API, реактивность, архитектура компонентов, Pinia, Nuxt.
225 587 ★
ui-ux-pro-maxnextlevelbuilder · Профессиональные знания по UI/UX-дизайну для ИИ-ассистентов программирования. Включает…
151 010 ★
hyperframesheygen-com · Все навыки HyperFrames в одном статическом наборе. В большинстве случаев лучше…
27 комп.
agentic-bundle-expo-react-nativesickn33 · Установите набор редакционных навыков "Expo & React Native" для Claude Code.
49 917 ★
aws-amplifyanthropics · Создание full-stack приложений на AWS Amplify Gen 2 с пошаговыми сценариями для…
100 комп.
base44anthropics · Создание и развёртывание full-stack приложений Base44 с управлением проектами через CLI и…
100 комп.
circle-skillsanthropics · Быстрее выпускайте приложения со стейблкоинами. Навыки лучших практик для платежей в…
100 комп.
code-modernizationanthropics · Модернизация устаревших кодовых баз (COBOL, старые Java/C++, монолитные веб-приложения) с…
100 комп.

Лучшие ИИ-инструменты для программирования

ИИ для программирования

Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные

GenAPIGenapi
По запросу
5.0
Notepad++ AINotepad-plus-plus
По запросу
4.9
GitHub CopilotGitHub
По подписке
4.9
Creatium MaxCremax
По запросу
4.8
Emacs AIGnu
По запросу
4.8
KiteKite
По запросу
4.8
Amazon Q DeveloperAmazon
По запросу
4.8
VECTA
Есть бесплатный тариф
4.8
SoftPractice
Есть бесплатный тариф
4.8
VibeForge
Есть бесплатный тариф
4.7

Лучшие ИИ-инструменты для генерации видео

Генерация видео

Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,

VEED.IOVeed
По запросу
5.0
MootionMootion
По запросу
5.0
FlyviFlyvi
Есть бесплатный тариф
4.9
Google Veo 3.1Google
Платно
4.9
Sora (OpenAI)OpenAI
Платно
4.9
PikaPika
Платно
4.9
captions space
Есть бесплатный тариф
4.8
Клайп
Есть бесплатный тариф
4.8
viralpulse.appViralpulse
По запросу
4.8
Viral Maker AIViral-maker
Есть бесплатный тариф
4.8

Лучшие ИИ-инструменты для генерации текста и копирайтинга

Генерация текста и копирайтинг

Подборка нейросетей для генерации текстов и копирайтинга. Сервисы, которые помогают создавать статьи, посты и рекламные объявления с нуля или по черновику, экономя часы рутинной ра

NeuroscribeNeuroscribe
Есть бесплатный тариф
5.0
GoGPTGogpt
По запросу
5.0
ChatsonicChatsonic
По запросу
4.9
НейроТекстерNeuro-texter
По запросу
4.9
ChatGPTOpenAI
По подписке
4.9
Редактум
Есть бесплатный тариф
4.8
ChadGPTChadgpt
По запросу
4.8
Cosmo ScribeCosmoscribe
Есть бесплатный тариф
4.8
Memo HelperCopilot33
По запросу
4.8
LibraChatLibrachat
Есть бесплатный тариф
4.8