wix-cli-dashboard-plugin by wix/skills
npx skills add https://github.com/wix/skills --skill wix-cli-dashboard-plugin为 Wix CLI 应用程序创建仪表板插件扩展。仪表板插件是交互式小组件,可嵌入到由 Wix 第一方商业应用(Wix Stores、Wix Bookings、Wix Blog、Wix eCommerce 等)管理的仪表板页面上的预定义槽位中。
仪表板插件占据其槽位的全部宽度,并根据内容保持动态高度。
创建仪表板插件时,请按顺序遵循以下步骤:
src/extensions/dashboard/plugins/<plugin-name>/extensions.dashboardPlugin() 和唯一的 UUID 创建 <plugin-name>.extension.tsWixDesignSystemProvider 包装的 React 组件 <plugin-name>.tsxsrc/extensions.ts 以导入并使用新的扩展广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
仪表板插件通过两种机制运行:
observeState() 实现插件与宿主页面数据之间的通信仪表板插件位于 src/extensions/dashboard/plugins/ 目录下。每个插件都有自己的文件夹。
src/extensions/dashboard/plugins/
└── <plugin-name>/
├── <plugin-name>.extension.ts # 构建器配置
└── <plugin-name>.tsx # React 组件
注意: 这是 CLI 创建的默认文件夹结构。您可以将这些文件移动到
src/文件夹内的任何位置,并更新extension.ts文件中的引用。
<plugin-name>.extension.tsimport { extensions } from "@wix/astro/builders";
export const dashboardpluginMyPlugin = extensions.dashboardPlugin({
id: "{{GENERATE_UUID}}",
title: "My Dashboard Plugin",
extends: "<SLOT_ID>",
component: "./extensions/dashboard/plugins/my-plugin/my-plugin.tsx",
});
关键:UUID 生成
id 必须是一个唯一的、静态的 UUID v4 字符串。为每个扩展生成一个新的 UUID — 请勿使用 randomUUID() 或复制示例中的 UUID。将 {{GENERATE_UUID}} 替换为新生成的 UUID,例如 "a1b2c3d4-e5f6-7890-abcd-ef1234567890"。
| 字段 | 类型 | 描述 |
|---|---|---|
id | string | 唯一的插件 ID (GUID)。在项目的所有扩展中必须是唯一的。 |
title | string | 插件标题。用于在项目仪表板中引用该插件。 |
extends | string | 托管插件的仪表板页面的槽位 ID。参见 槽位参考。 |
component | string | 指向插件内容组件(.tsx 文件)的相对路径。 |
extends 字段extends 字段指定哪个仪表板页面槽位托管您的插件。每个 Wix 商业应用在其仪表板页面上都会暴露槽位。您必须提供确切的槽位 ID。
重要提示: 某些具有相同 ID 的槽位会出现在仪表板内的不同页面上。如果您为存在于多个页面上的槽位创建插件,则该插件将在所有这些页面上显示。
有关可用槽位 ID 的完整列表,请参阅 槽位参考。
<plugin-name>.tsx插件组件是一个在仪表板页面槽位内渲染的 React 组件。
import type { FC } from "react";
import { WixDesignSystemProvider, Card, Text } from "@wix/design-system";
import "@wix/design-system/styles.global.css";
const Plugin: FC = () => {
return (
<WixDesignSystemProvider features={{ newColorsBranding: true }}>
<Card>
<Card.Header title="My Plugin" />
<Card.Divider />
<Card.Content size="medium">
<Text>Plugin content goes here.</Text>
</Card.Content>
</Card>
</WixDesignSystemProvider>
);
};
export default Plugin;
@wix/dashboard) — 与传递给槽位的仪表板页面数据进行交互@wix/design-system) — 与 Wix 自身仪表板 UI 匹配的原生风格 React 组件使用 Dashboard SDK 中的 observeState() 来接收来自宿主仪表板页面的数据:
import { dashboard } from "@wix/dashboard";
import { useEffect, useState } from "react";
const Plugin: FC = () => {
const [params, setParams] = useState<Record<string, unknown>>({});
useEffect(() => {
dashboard.observeState((componentParams) => {
setParams(componentParams);
});
}, []);
return (
<WixDesignSystemProvider features={{ newColorsBranding: true }}>
<Card>
<Card.Content size="medium">
<Text>Received data: {JSON.stringify(params)}</Text>
</Card.Content>
</Card>
</WixDesignSystemProvider>
);
};
一些 Wix 应用为其槽位参数暴露了类型化的接口。从应用的仪表板包中导入它们:
import type { plugins } from "@wix/blog/dashboard";
type Props = plugins.BlogPosts.PostsBannerParams;
const Plugin: FC<Props> = (props) => {
// props 根据 Blog Posts 槽位契约进行类型化
};
注意: 类型化 props 的可用性因 Wix 应用而异。请查阅特定应用的 SDK 文档。并非所有槽位都提供类型化的参数接口。
扩展注册是强制性的,并且需要两个步骤。
每个仪表板插件都需要在其文件夹中有一个 <plugin-name>.extension.ts 文件。请参阅上面的插件构建器配置。
关键: 创建插件特定的扩展文件后,您必须阅读 wix-cli-extension-registration 并按照“应用注册”部分更新 src/extensions.ts。
如果不完成步骤 2,仪表板插件将不会出现在仪表板页面上。
| 症状 | 原因 | 修复方法 |
|---|---|---|
| 插件未出现在仪表板页面 | 缺少注册 | 在 src/extensions.ts 中导入并使用 .use() |
| 插件未出现在仪表板页面 | 错误的槽位 ID | 验证 extends 字段是否与 槽位参考 中的有效槽位 ID 匹配 |
extends 字段必须包含来自 Wix 商业应用的有效槽位 ID — 请勿发明槽位 ID!) 和不安全的类型转换 (as any)// @ts-ignore 或 // @ts-expect-error;应修复类型或添加守卫请求: “为 Wix Blog 文章页面创建一个显示促销横幅的插件”
输出: 针对槽位 46035d51-2ea9-4128-a216-1dba68664ffe(博客文章页面)的插件,包含一个显示促销内容的 Card 组件,使用 observeState() 访问博客文章数据。
请求: “在 Wix Bookings 员工页面上添加一个显示每周可用性的插件”
输出: 针对槽位 261e84a2-31d0-4258-a035-10544d251108(预订员工页面)的插件,包含一个日程显示组件,使用 observeState() 接收员工数据。
请求: “在电子商务订单页面上创建一个显示履行状态的插件”
输出: 针对槽位 cb16162e-42aa-41bd-a644-dc570328c6cc(电子商务订单页面)的插件,包含状态徽章和履行详情,使用 observeState() 访问订单数据。
令牌限制: 您的最大输出约为 10,000 个令牌。请规划您的响应以保持在此限制以下。
每周安装量
130
代码仓库
GitHub 星标
3
首次出现
2026年3月2日
安全审计
已安装于
opencode127
gemini-cli48
cursor48
amp47
codex47
kimi-cli47
Creates dashboard plugin extensions for Wix CLI applications. Dashboard plugins are interactive widgets that embed into predefined slots on dashboard pages managed by Wix first-party business apps (Wix Stores, Wix Bookings, Wix Blog, Wix eCommerce, etc.).
Dashboard plugins occupy the full width of their slot and maintain dynamic height based on content.
Follow these steps in order when creating a dashboard plugin:
src/extensions/dashboard/plugins/<plugin-name>/<plugin-name>.extension.ts with extensions.dashboardPlugin() and unique UUID<plugin-name>.tsx with React component wrapped in WixDesignSystemProvidersrc/extensions.ts to import and use the new extensionDashboard plugins operate through two mechanisms:
observeState()Dashboard plugins live under src/extensions/dashboard/plugins/. Each plugin has its own folder.
src/extensions/dashboard/plugins/
└── <plugin-name>/
├── <plugin-name>.extension.ts # Builder configuration
└── <plugin-name>.tsx # React component
Note: This is the default folder structure created by the CLI. You can move these files to any location within the
src/folder and update the references in yourextension.tsfile.
<plugin-name>.extension.tsimport { extensions } from "@wix/astro/builders";
export const dashboardpluginMyPlugin = extensions.dashboardPlugin({
id: "{{GENERATE_UUID}}",
title: "My Dashboard Plugin",
extends: "<SLOT_ID>",
component: "./extensions/dashboard/plugins/my-plugin/my-plugin.tsx",
});
CRITICAL: UUID Generation
The id must be a unique, static UUID v4 string. Generate a fresh UUID for each extension — do NOT use randomUUID() or copy UUIDs from examples. Replace {{GENERATE_UUID}} with a freshly generated UUID like "a1b2c3d4-e5f6-7890-abcd-ef1234567890".
| Field | Type | Description |
|---|---|---|
id | string | Unique plugin ID (GUID). Must be unique across all extensions in the project. |
title | string | Plugin title. Used to refer to the plugin in the project dashboard. |
extends | string | Slot ID of the dashboard page hosting the plugin. See Slots Reference. |
component | string | Relative path to the plugin content component (.tsx file). |
extends FieldThe extends field specifies which dashboard page slot hosts your plugin. Each Wix business app exposes slots on its dashboard pages. You must provide the exact slot ID.
Important: Some slots with the same ID appear on different pages within the dashboard. If you create a plugin for a slot that exists on multiple pages, the plugin is displayed on all of those pages.
For the complete list of available slot IDs, see Slots Reference.
<plugin-name>.tsxThe plugin component is a React component that renders within the dashboard page slot.
import type { FC } from "react";
import { WixDesignSystemProvider, Card, Text } from "@wix/design-system";
import "@wix/design-system/styles.global.css";
const Plugin: FC = () => {
return (
<WixDesignSystemProvider features={{ newColorsBranding: true }}>
<Card>
<Card.Header title="My Plugin" />
<Card.Divider />
<Card.Content size="medium">
<Text>Plugin content goes here.</Text>
</Card.Content>
</Card>
</WixDesignSystemProvider>
);
};
export default Plugin;
@wix/dashboard) — Interact with the dashboard page's data passed to the slot@wix/design-system) — Native-looking React components matching Wix's own dashboard UIUse observeState() from the Dashboard SDK to receive data from the host dashboard page:
import { dashboard } from "@wix/dashboard";
import { useEffect, useState } from "react";
const Plugin: FC = () => {
const [params, setParams] = useState<Record<string, unknown>>({});
useEffect(() => {
dashboard.observeState((componentParams) => {
setParams(componentParams);
});
}, []);
return (
<WixDesignSystemProvider features={{ newColorsBranding: true }}>
<Card>
<Card.Content size="medium">
<Text>Received data: {JSON.stringify(params)}</Text>
</Card.Content>
</Card>
</WixDesignSystemProvider>
);
};
Some Wix apps expose typed interfaces for their slot parameters. Import them from the app's dashboard package:
import type { plugins } from "@wix/blog/dashboard";
type Props = plugins.BlogPosts.PostsBannerParams;
const Plugin: FC<Props> = (props) => {
// props are typed according to the Blog Posts slot contract
};
Note: Typed props availability varies by Wix app. Consult the specific app's SDK documentation. Not all slots provide typed parameter interfaces.
Extension registration is MANDATORY and has TWO required steps.
Each dashboard plugin requires an <plugin-name>.extension.ts file in its folder. See Plugin Builder Configuration above.
CRITICAL: After creating the plugin-specific extension file, you MUST read wix-cli-extension-registration and follow the "App Registration" section to update src/extensions.ts.
Without completing Step 2, the dashboard plugin will not appear on the dashboard page.
| Symptom | Cause | Fix |
|---|---|---|
| Plugin not appearing on dashboard page | Missing registration | Import and .use() in src/extensions.ts |
| Plugin not appearing on dashboard page | Wrong slot ID | Verify extends field matches a valid slot ID from Slots Reference |
extends field MUST contain a valid slot ID from a Wix business app — do NOT invent slot IDs!) and unsafe casts (as any)// @ts-ignore or // @ts-expect-error; fix the types or add guards insteadRequest: "Create a plugin for the Wix Blog posts page that shows a promotional banner"
Output: Plugin targeting slot 46035d51-2ea9-4128-a216-1dba68664ffe (Blog Posts page) with a Card component displaying promotional content, using observeState() to access blog post data.
Request: "Add a plugin to the Wix Bookings staff page that shows weekly availability"
Output: Plugin targeting slot 261e84a2-31d0-4258-a035-10544d251108 (Bookings Staff page) with a schedule display component, using observeState() to receive staff data.
Request: "Create a plugin on the eCommerce order page showing fulfillment status"
Output: Plugin targeting slot cb16162e-42aa-41bd-a644-dc570328c6cc (eCommerce Order page) with status badges and fulfillment details, using observeState() to access order data.
Token limits: Your max output is ~10,000 tokens. Plan your response to stay under this limit.
Weekly Installs
130
Repository
GitHub Stars
3
First Seen
Mar 2, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode127
gemini-cli48
cursor48
amp47
codex47
kimi-cli47
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
116,600 周安装
Azure App Insights 仪表化技能 - 为ASP.NET Core/Node.js应用添加遥测监控
8,400 周安装
baoyu-translate 三模式翻译工具:快速、常规、精炼,支持 Markdown 分块与自定义偏好设置
8,500 周安装
资深Go开发专家 | Go 1.21+、并发编程、云原生微服务、性能优化
8,500 周安装
PostgreSQL代码审查助手 - 专业SQL优化、JSONB最佳实践与模式设计审查
8,500 周安装
数据库迁移指南:跨ORM(Sequelize/TypeORM/Prisma)模式转换与零停机部署
8,500 周安装
Nuxt UI - 基于Reka UI和Tailwind的Vue组件库,支持Nuxt/Vue/Laravel/AdonisJS
8,600 周安装