marketplace-build-component

bởi vercel

Xây dựng các thành phần giao diện người dùng bằng hệ thống thiết kế Blok cho các ứng dụng Sitecore Marketplace. Sử dụng khi người dùng muốn tạo giao diện, thêm thành phần, xây dựng bố cục trang, hoặc…

npx skills add https://github.com/vercel-labs/sitecore-skills --skill marketplace-build-component

Build UI with Blok Design System

You are helping the user build UI components for a Sitecore Marketplace app using the Blok design system (Sitecore's shadcn-based component library).

Key Principles

  1. Always use Blok components — they match the Sitecore host UI and support light/dark themes automatically
  2. SDK data integration — use loading states (Skeleton) and error states (Alert) when fetching SDK data
  3. Extension point awareness — different extension types have different UI constraints (see below)
  4. Responsive — components render inside iframes of varying sizes

Installing Components

Blok components are installed via the shadcn CLI:

# Install the Blok theme (required first)
npx shadcn@latest add https://marketplace-sdk.sitecorecloud.io/r/blok-theme.json

# Install individual components
npx shadcn@latest add https://marketplace-sdk.sitecorecloud.io/r/<component-name>.json

See blok-components.md for the full component catalog with install commands.

UI Patterns by Extension Type

Compact Field (custom-field)

  • Very limited space (~300px wide, variable height)
  • Use: Input, Select, Badge, small inline components
  • Avoid: Tables, large layouts, modals

Dashboard Widget

  • Medium space (~400x300px default, resizable)
  • Use: Cards, Charts, Stats, compact Tables
  • Good for: Summary data, quick actions

Pages Context Panel

  • Side panel (~350px wide, full height)
  • Use: Vertical layouts, Lists, Accordion, Tabs
  • Good for: Contextual info about current page, actions

Fullscreen

  • Full viewport within the Sitecore shell
  • Use: Any components, complex layouts, Tables, Forms
  • Good for: Full CRUD interfaces, dashboards, settings

Standalone

  • Independent page, not in Sitecore shell
  • Use: Any components, full creative freedom
  • Good for: Public-facing pages, OAuth callbacks

SDK Data Integration Pattern

"use client";

import { useEffect, useState } from "react";
import { useMarketplaceClient, useAppContext } from "@/components/providers/marketplace";
import { Skeleton } from "@/components/ui/skeleton";
import { Alert, AlertDescription } from "@/components/ui/alert";

export function MyComponent() {
  const { client } = useMarketplaceClient();
  const appContext = useAppContext();
  const [error, setError] = useState<string | null>(null);

  const loading = !appContext;

  if (loading) return <Skeleton className="h-32 w-full" />;
  if (error) return <Alert variant="destructive"><AlertDescription>{error}</AlertDescription></Alert>;

  return <div>{/* Render data */}</div>;
}

Reference Files

Thêm skills từ vercel

benchmark-sandbox
vercel
Chạy các kịch bản đánh giá vercel-plugin trong Vercel Sandboxes thay vì các bảng WezTerm cục bộ. Cung cấp các microVM tạm thời với Claude Code và plugin được cài đặt sẵn,…
official
emil-design-eng
vercel
Kỹ năng này mã hóa triết lý của Emil Kowalski về trau chuốt giao diện người dùng, thiết kế thành phần, quyết định hoạt ảnh và những chi tiết vô hình giúp phần mềm mang lại cảm giác tuyệt vời.
official
vercel-react-best-practices
vercel
Hướng dẫn tối ưu hiệu suất React và Next.js từ Vercel Engineering. Kỹ năng này nên được sử dụng khi viết, xem xét hoặc tái cấu trúc mã React/Next.js…
official
vercel-react-best-practices
vercel
Hướng dẫn tối ưu hiệu suất React và Next.js từ Vercel Engineering. Kỹ năng này nên được sử dụng khi viết, xem xét hoặc tái cấu trúc mã React/Next.js…
official
write-guide
vercel
Tạo một hướng dẫn kỹ thuật dạy một trường hợp sử dụng thực tế thông qua các ví dụ tiến dần. Các khái niệm chỉ được giới thiệu khi người đọc cần đến chúng.
official
release
vercel
Phát hành vercel-plugin — chạy các cổng, tăng phiên bản, tạo tạo phẩm, commit và push. Sử dụng khi được yêu cầu "phát hành", "ship", "tăng và push", hoặc "cắt một bản phát hành".
official
deepsec
vercel
Chạy DeepSec trên bản checkout dự án Vercel từ dev3000. Sử dụng để thiết lập DeepSec một chạm, khởi tạo ngữ cảnh dự án, xử lý lần đầu có giới hạn, và…
official
backport-pr
vercel
Backport một pull request Next.js đã được merge từ canary sang một nhánh phát hành trước đó như next-16-2. Sử dụng khi người dùng yêu cầu backport, cherry-pick, hoặc mở một…
official