Wix Design System

作者 wix8fc544d319c4無授權條款收錄於 2026年10月8日更新於 2026年10月8日

Wix Design System component reference. Use when building UI with @wix/design-system, choosing components, checking props and examples, or writing tests with component testkits. Triggers on "what component", "how do I make", "WDS", "show me props", "testkit", "driver", or component names like Button, Card, Modal, Box, Text.

AI 產生的概覽

Wix 設計系統參考導覽器,用來查詢元件、屬性、範例、測試工具包與圖示。

功能
此技能為 @wix/design-system 元件庫提供文件導覽。它附帶一個 Node.js 輔助指令碼,可依關鍵字搜尋元件、傳回屬性與範例清單、取得特定 JSX 範例、輸出測試工具包匯入與驅動 API,並搜尋圖示。它也提供直接檢索已安裝文件檔案的備用方式,以及元件對應與間距換算表。
適用情境
在使用 @wix/design-system 建構介面、挑選元件、查看屬性或範例,或以測試工具包撰寫元件測試時使用。它也適合將像素間距換算為 SP 權杖以及尋找圖示。
執行需求
需要 Node.js,以及專案中已安裝 @wix/design-system 套件(npm 或 yarn)。它附帶可執行指令碼 scripts/wds.cjs,並從 node_modules/@wix/design-system/dist/docs/ 讀取文件。未提及憑證或網路存取。

WDS Documentation Navigator

Prerequisite: @wix/design-system must be installed (npm i @wix/design-system or yarn add @wix/design-system).

Helper Script

This skill bundles scripts/wds.cjs — a Node.js helper that auto-discovers @wix/design-system in node_modules (handles monorepos and workspaces) and provides focused lookups. Run it from the user's project directory using the absolute path to the bundled script:

bash
# WDS is the absolute path to this skill's scripts/wds.cjsWDS="<this-skill-dir>/scripts/wds.cjs"
node $WDS search <keyword>                 # Find components by keywordnode $WDS component <Name>                 # Get props + example list (one component)node $WDS components <Name1> <Name2>...    # Same as `component`, but for several at oncenode $WDS example <Name> "<ExampleName>"   # Get a specific examplenode $WDS testkit <Name> [method]          # Get testkit imports + driver APInode $WDS icons <query>                    # Search for icons

Workflow

Step 1: Find the right component

bash
node $WDS search tablenode $WDS search form input validationnode $WDS search modal dialog popup

Multiple keywords are OR-matched. Returns component names, descriptions, and usage guidance.

Step 2: Get props and available examples

bash
node $WDS component Button

Returns the full props list (types and descriptions) plus a list of all available examples. For large prop files (>200 lines), returns a summary with prop names and types.

If you already know which several components you'll need (e.g. after Step 1 returned a shortlist), prefer the batch form to avoid one round-trip per component:

bash
node $WDS components Button Card Table Input Text Thumbnail

Output is each component's props block separated by ---. Missing components are logged to stderr and skipped; the command only fails if every requested component is missing.

Step 3: Get a specific example

bash
node $WDS example Button "Loading state"

Returns the example description and JSX code. Matching is case-insensitive and supports substrings (e.g., "loading" matches "Loading state").

Step 4: Write tests with the component testkit

bash
node $WDS testkit Button             # Imports + full driver API for Buttonnode $WDS testkit Button click       # Just the click() method details

Returns import snippets for unidriver, vanilla, puppeteer, and playwright flavors plus the driver method API (name, args, return type, description). Method name matching is case-insensitive substring.

Step 5: Find icons

bash
node $WDS icons Add Edit Delete

Icons are from @wix/wix-ui-icons-common. Each icon has a Small variant (e.g., Add + AddSmall).

Fallback: Direct File Access

If the script is unavailable, docs are at node_modules/@wix/design-system/dist/docs/:

  • components.md — component catalog (~978 lines, grep only)
  • components/{Name}Props.md — props per component
  • components/{Name}Examples.md — examples per component (grep ^### for section list)
  • components/{Name}Testkit.md — testkit imports + driver API per component (grep ^### for method list)
  • testkits.md — testkit catalog (list of components with generated testkit docs)
  • icons.md — icon catalog (~818 lines, grep only)

Don't read these files fully. Grep for keywords, then read specific sections with offset/limit. See references/file-structure.md [blocked] for the exact docs file layout and section shapes.


Quick Component Mapping (Design to WDS)

Design ElementWDS ComponentNotes
Rectangle/container<Box>Layout wrapper
Text button<TextButton>Secondary actions
Input with label<FormField> + <Input>Wrap inputs
Toggle<ToggleSwitch>On/off settings
Modal<Modal> + <CustomModalLayout>Use together
Grid<Layout> + <Cell>Responsive

Spacing (px to SP conversion)

When designer specifies pixels, convert to the nearest SP token:

TokenClassicStudio
SP16px4px
SP212px8px
SP318px12px
SP424px16px
SP530px20px
SP636px24px
tsx
<Box gap="SP2" padding="SP3">

Only use SP tokens for gap, padding, margin — not for width/height.

Imports

tsx
import { Button, Card, Image } from "@wix/design-system";import { Add, Edit, Delete } from "@wix/wix-ui-icons-common";

GUIDELINES

  1. Don't ever override WDS CSS tokens. Only if it's not possible otherwise, mention that very clearly to the prompter, that this is an anti-pattern and should be avoided at all costs.

Troubleshooting

  • Components render unstyled (plain HTML look, missing WDS spacing/typography): add import "@wix/design-system/styles.global.css"; once to the root/main component (e.g. page.tsx, modal entry) — not child/tab/helper files.

來源與署名

來源:wix/skills位於skills/wix-design-system提交8fc544d

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架