Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计未展示

wix-cli-site-widgetWIX CLI site widget CLI

Agent Skill

wix-cli-site-widget 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

517

周安装

22

GitHub Stars

公开资料未说明

下载量

181
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:wix-cli-site-widget(WIX CLI site widget CLI)
来源仓库:https://github.com/wix-incubator/skills
仓库路径:skills/wix-cli-site-widget
安装命令:
npx skills add wix-incubator/skills --skill "wix-cli-site-widget"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add wix-incubator/skills --skill "wix-cli-site-widget"

简介

发现并安装 AI 代理的技能。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 等宿主环境。
  • 支持根据关键词快速定位候选技能结果。
  • 通过 npx 命令从 GitHub 仓库安装,注意权限和网络访问限制。
  • wix-cli-site-widget 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
wix-cli-site-widget
description
Use when building interactive widgets, custom data displays, or configurable site components with settings panels. Triggers include widget, custom element, interactive component, countdown timer, calculator, showcase, gallery, editor component, configurable widget, web component.
compatibility
Requires Wix CLI development environment.

Wix Site Widget Builder

Creates custom element widget extensions for Wix CLI applications. Site widgets are React components converted to web components that appear in the Wix Editor, allowing site owners to add interactive, configurable widgets to their pages with a built-in settings panel.

Quick Start Checklist

Follow these steps in order when creating a site widget:

  1. [ ] Create widget folder: src/site/widgets/custom-elements/<widget-name>/
  2. [ ] Create widget.tsx with React component and reactToWebComponent conversion
  3. [ ] Create panel.tsx with WDS components and widget.getProp/setProp
  4. [ ] Create extensions.ts with extensions.customElement() and unique UUID
  5. [ ] Update src/extensions.ts to import and use the new extension
  6. [ ] Run npx tsc --noEmit to verify TypeScript compiles
  7. [ ] Run npx wix build and npx wix preview to test
  8. [ ] Verify widget appears in Wix Editor Add Panel

Non-Matching Intents

Do NOT use this skill for:

  • Dashboard admin interfaces → Use wix-cli-dashboard-page
  • Embedded scripts (HTML/JavaScript injection) → Use wix-cli-embedded-script
  • Backend API endpoints → Use wix-cli-backend-api
  • Service plugins (eCommerce SPIs) → Use wix-cli-service-plugin
  • Site components (React-only, no settings panel) → Use wix-site-component
  • Plugins for Wix app slots (Stores, Bookings) → Use wix-cli-site-plugin

Site Widget vs Site Plugin

FeatureSite WidgetSite Plugin
Target locationAnywhere on site pagesPredefined slots in Wix business solutions
Component typeReact → Web Component (react-to-webcomponent)Native HTMLElement
Use caseStandalone interactive widgetsExtend Wix business solutions
PlacementAdd Panel in Wix EditorPlugin explorer in Wix Editor
Props conventioncamelCase (widget) / kebab-case (panel)kebab-case only

Choose Site Widget when: You need a standalone widget (countdown timer, calculator, gallery) that site owners can place anywhere.

Choose Site Plugin when: You need to extend predefined slots in Wix business solutions.

Architecture

Site widgets consist of two required files:

1. Widget Component (widget.tsx)

React component converted to a web component using react-to-webcomponent:

  • Define Props interface with configurable properties (camelCase)
  • Create a React functional component that renders the widget UI
  • Convert to web component with props mapping
  • Use inline styles (no CSS imports)
  • Handle Wix Editor environment when using Wix Data API

2. Settings Panel (panel.tsx)

Settings panel shown in the Wix Editor sidebar:

  • Uses Wix Design System components (see references/WDS-COMPONENTS.md)
  • Manages widget properties via @wix/editor widget API
  • Loads initial values with widget.getProp('kebab-case-name')
  • Updates properties with widget.setProp('kebab-case-name', value)
  • Wrapped in WixDesignSystemProvider > SidePanel > SidePanel.Content

Widget Component Pattern

import React, { type FC, useState, useEffect } from "react";
import ReactDOM from "react-dom";
import reactToWebComponent from "react-to-webcomponent";

interface WidgetProps {
  title?: string;
  targetDate?: string;
  bgColor?: string;
  textColor?: string;
  font?: string;
}

const CustomElement: FC<WidgetProps> = ({
  title = "Default Title",
  targetDate = "",
  bgColor = "#ffffff",
  textColor = "#333333",
  font = "{}",
}) => {
  // Parse font if needed
  const { font: textFont, textDecoration } = JSON.parse(font);

  // Component logic and state
  const [data, setData] = useState(null);

  // Use inline styles
  const styles = {
    wrapper: {
      display: "flex",
      flexDirection: "column",
      padding: "20px",
      backgroundColor: bgColor,
      color: textColor,
      fontFamily: textFont || "inherit",
    },
  };

  return (
    <div style={styles.wrapper}>
      {title && <h2 style={{ margin: 0 }}>{title}</h2>}
      {/* Widget content */}
    </div>
  );
};

// Convert to web component
const customElement = reactToWebComponent(CustomElement, React, ReactDOM, {
  props: {
    title: "string",
    targetDate: "string",
    bgColor: "string",
    textColor: "string",
    font: "string",
  },
});

export default customElement;

Key Points:

  • Props interface uses camelCase (e.g., targetDate, bgColor)
  • reactToWebComponent config uses camelCase keys with 'string' type
  • All props are passed as strings from the web component
  • Use inline styles, not CSS imports
  • Parse complex props (like font) from JSON strings if needed

Settings Panel Pattern

import React, { type FC, useState, useEffect, useCallback } from "react";
import { widget } from "@wix/editor";
import {
  SidePanel,
  WixDesignSystemProvider,
  Input,
  FormField,
  Box,
} from "@wix/design-system";
import "@wix/design-system/styles.global.css";

const Panel: FC = () => {
  const [title, setTitle] = useState<string>("");
  const [targetDate, setTargetDate] = useState<string>("");
  const [bgColor, setBgColor] = useState<string>("#ffffff");

  // Load initial values (kebab-case prop names)
  useEffect(() => {
    Promise.all([
      widget.getProp("title"),
      widget.getProp("target-date"),
      widget.getProp("bg-color"),
    ])
      .then(([titleVal, dateVal, bgColorVal]) => {
        setTitle(titleVal || "");
        setTargetDate(dateVal || "");
        setBgColor(bgColorVal || "#ffffff");
      })
      .catch((error) =>
        console.error("Failed to fetch widget properties:", error)
      );
  }, []);

  // Update both local state and widget prop (kebab-case)
  const handleTitleChange = useCallback(
    (event: React.ChangeEvent<HTMLInputElement>) => {
      const newTitle = event.target.value;
      setTitle(newTitle);
      widget.setProp("title", newTitle);
    },
    []
  );

  const handleDateChange = useCallback(
    (event: React.ChangeEvent<HTMLInputElement>) => {
      const newDate = event.target.value;
      setTargetDate(newDate);
      widget.setProp("target-date", newDate);
    },
    []
  );

  return (
    <WixDesignSystemProvider>
      <SidePanel width="300" height="100vh">
        <SidePanel.Header title="Widget Settings" />
        <SidePanel.Content noPadding stretchVertically>
          <Box direction="vertical" gap="24px">
            <SidePanel.Field>
              <FormField label="Title">
                <Input
                  type="text"
                  value={title}
                  onChange={handleTitleChange}
                  placeholder="Enter title"
                />
              </FormField>
            </SidePanel.Field>

            <SidePanel.Field>
              <FormField label="Target Date">
                <Input
                  type="date"
                  value={targetDate}
                  onChange={handleDateChange}
                />
              </FormField>
            </SidePanel.Field>
          </Box>
        </SidePanel.Content>
      </SidePanel>
    </WixDesignSystemProvider>
  );
};

export default Panel;

Key Points:

  • Prop names in widget.getProp() and widget.setProp() use kebab-case (e.g., "target-date", "bg-color")
  • Always update both local state AND widget prop in onChange handlers
  • Wrap content in WixDesignSystemProvider > SidePanel > SidePanel.Content
  • Use WDS components from @wix/design-system (see references/WDS-COMPONENTS.md)
  • Import @wix/design-system/styles.global.css for styles

Querying WDS Component Details

For detailed information about WDS components (descriptions, usage guidelines, feature examples, code snippets), use the shared query script:

node ./scripts/query-wds-components.js <component-name> [<component-name> ...]

# Examples:
node ./scripts/query-wds-components.js FormField Input
node ./scripts/query-wds-components.js SidePanel SidePanel.Header
node ./scripts/query-wds-components.js ToggleSwitch DatePicker

The script reads from assets/wds-storybook.json and outputs formatted component information. This is useful when you need specific prop usage examples, best practices, or feature-specific code examples beyond what's documented in WDS-COMPONENTS.md.

Props Naming Convention

Critical: Props use different naming conventions in each file:

FileConventionExample
widget.tsx (Props interface)camelCasetargetDate, bgColor, textColor
panel.tsx (widget API)kebab-case"target-date", "bg-color", "text-color"
reactToWebComponent configcamelCasetargetDate: 'string'

The web component automatically converts between camelCase (React props) and kebab-case (HTML attributes).

Wix Data API Integration

When using Wix Data API in widgets, you must handle the Wix Editor environment gracefully:

import { items } from "@wix/data";
import { window as wixWindow } from "@wix/site-window";

const CustomElement: FC<WidgetProps> = ({ collectionId }) => {
  const [data, setData] = useState(null);
  const [isEditor, setIsEditor] = useState(false);

  useEffect(() => {
    const loadData = async () => {
      const currentViewMode = await wixWindow.viewMode();

      if (currentViewMode === "Editor") {
        // Don't fetch data in editor - show placeholder
        setIsEditor(true);
        return;
      }

      // Fetch real data only on live site
      try {
        const results = await items.query(collectionId).limit(10).find();
        setData(results.items);
      } catch (error) {
        console.error("Failed to load data:", error);
      }
    };

    loadData();
  }, [collectionId]);

  if (isEditor) {
    return (
      <div style={{ padding: "20px", border: "2px dashed #ccc" }}>
        <p>Widget will display data on the live site</p>
        <p>Collection: {collectionId}</p>
      </div>
    );
  }

  // Render widget with real data
  return (
    <div>
      {data?.map((item) => (
        <div key={item._id}>{item.title}</div>
      ))}
    </div>
  );
};

Requirements:

  • Import { window as wixWindow } from "@wix/site-window"
  • Check await wixWindow.viewMode() before fetching data
  • If viewMode === 'Editor', show a placeholder UI instead
  • Only fetch and render real data when NOT in editor mode

Font Selection

For font selection in settings panels, use FontPickerField component with inputs.selectFont():

import { inputs } from "@wix/editor";
import { FontPickerField } from "./components/FontPickerField";

const Panel: FC = () => {
  const [font, setFont] = useState({ font: "", textDecoration: "" });

  const handleFontChange = async () => {
    const selectedFont = await inputs.selectFont();
    if (selectedFont) {
      const fontValue = {
        font: selectedFont.fontFamily || "",
        textDecoration: selectedFont.textDecoration || "",
      };
      setFont(fontValue);
      widget.setProp("font", JSON.stringify(fontValue));
    }
  };

  return (
    <FontPickerField
      label="Text Font"
      value={font}
      onChange={handleFontChange}
    />
  );
};

Important: Use inputs.selectFont() from @wix/editor, NOT a text Input. This provides a rich font picker dialog with bold, italic, size, and typography features.

Output Structure

src/site/widgets/custom-elements/
└── {widget-name}/
    ├── widget.tsx           # Main widget component
    ├── panel.tsx            # Settings panel component
    ├── extensions.ts         # Extension registration
    ├── components/          # Optional sub-components
    │   ├── ColorPickerField.tsx
    │   └── FontPickerField.tsx
    └── utils/               # Optional helper functions
        └── formatters.ts

Examples

Countdown Timer Widget

Request: "Create a countdown timer widget"

Output:

  • Widget with configurable title, target date/time, colors, and font
  • Settings panel with date picker, time input, color pickers, font picker
  • Real-time countdown display with days, hours, minutes, seconds

Product Showcase Widget

Request: "Create a widget that displays products from a collection"

Output:

  • Widget that queries Wix Data collection
  • Editor environment handling (shows placeholder in editor)
  • Settings panel for collection selection, display options, styling
  • Responsive grid layout with product cards

Interactive Calculator Widget

Request: "Create a calculator widget with customizable colors"

Output:

  • Functional calculator component
  • Settings panel for color customization (background, buttons, text)
  • Inline styles for all styling
  • No external dependencies

Frontend Aesthetics

Avoid generic aesthetics. Create distinctive designs with unique fonts (avoid Inter, Roboto, Arial), cohesive color palettes, CSS animations for micro-interactions, and context-specific choices. Don't use clichéd color schemes or predictable layouts.

Extension Registration

Extension registration is MANDATORY and has TWO required steps.

Step 1: Create Widget-Specific Extension File

Each site widget requires an extensions.ts file in its folder:

import { extensions } from "@wix/astro/builders";

export const sitewidgetMyWidget = extensions.customElement({
  id: "{{GENERATE_UUID}}",
  name: "My Widget",
  tagName: "my-widget",
  element: "./site/widgets/custom-elements/my-widget/widget.tsx",
  settings: "./site/widgets/custom-elements/my-widget/panel.tsx",
  installation: {
    autoAdd: true,
  },
  width: {
    defaultWidth: 500,
    allowStretch: true,
  },
  height: {
    defaultHeight: 500,
  },
});

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

PropertyTypeDescription
idstringUnique static UUID v4 (generate fresh)
namestringDisplay name in editor
tagNamestringHTML custom element tag (kebab-case)
elementstringPath to widget React component
settingsstringPath to settings panel component
installationobjectAuto-add behavior
widthobjectDefault width and stretch settings
heightobjectDefault height settings

Step 2: Register in Main Extensions File

CRITICAL: After creating the widget-specific extension file, you MUST read ../../skills/references/EXTENSIONS.md and follow the "App Registration" section to update src/extensions.ts.

Without completing Step 2, the site widget will not be available in the Wix Editor.

Verification

After implementation, use wix-cli-app-validation to validate TypeScript compilation, build, preview, and runtime behavior.

Code Quality Requirements

  • Strict TypeScript (no any, explicit return types)
  • Functional React components with hooks
  • Proper error handling and loading states
  • No @ts-ignore comments
  • Inline styles only (no CSS imports)
  • Handle Wix Editor environment when using Wix Data API
  • Consistent prop naming (camelCase in widget, kebab-case in panel)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.89%
按下载量换算50

windsurf

22.72%
按下载量换算41

trae

17.65%
按下载量换算32

OpenCode

14.36%
按下载量换算26

Codex

9.06%
按下载量换算16

Antigravity

3.61%
按下载量换算7

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills