deskpack.json
SCHEMA

REACT WIDGET SDK / MANIFEST

deskpack.json

deskpack.json is the single manifest file of every widget package. It declares identity, supported sizes and custom dimensions, and options that automatically render into Deskset's native Edit Widget panel. Reference deskpack.schema.json for IDE validation.

1. Package Layout#

TEXT
my-widget/
├── deskpack.json        # Required: manifest & user options schema
├── index.tsx            # Required: default export React function component
├── src/                 # Optional: modular helper files (TS/TSX)
│   └── helpers.ts
├── locales/             # Optional (recommended): BCP-47 JSON localization files
│   ├── en.json
│   └── zh-Hans.json
└── assets/              # Optional: bundled images (PNG/JPG/WebP/SVG)
    └── cover.png

2. Top-Level Fields#

idstringRequired
Globally unique reverse-DNS identifier (e.g. com.you.water-counter). Must match ^[a-z0-9][a-z0-9._-]{2,63}$.
namestringRequired
Default display name used as fallback when locales/<tag>.json _meta.name is not provided.
nameZhstringOptional
Simplified Chinese fallback name (used when locales/zh-Hans.json _meta.name is absent).
versionstringRequired
Semantic version string (e.g. "1.0.0"), used during in-place upgrades.
descriptionstringOptional
Default short summary displayed in the Widget Library (overridable per locale via _meta.description).
descriptionZhstringOptional
Simplified Chinese fallback summary.
defaultLocalestringOptional
Default fallback BCP-47 locale tag for locales/ (e.g. "en", "zh-Hans"). Defaults to "en".
authorstringOptional
Author name or handle (e.g. "@you").
categorystringOptional
Catalog category: time, productivity, media, info, system, or community.
iconstringOptional
SF Symbol name (e.g. "drop.fill", "sparkles") shown in lists and inspectors.
sizesstring[]Required
Supported sizes array containing any of "small", "medium", "large", "custom". Branch per-size layouts inside your component with useWidget().match(...) — see useWidget.
sizeDimensionsobjectOptional
Map keyed by size name (e.g. "custom") overriding default dimensions and resize bounds — see §3 below.
stylesstring[]Optional
Optional visual variants supported by this widget (e.g. ["glass", "minimal"]). Declaring both enables per-widget Glass / Minimal switching in Edit Widget and Widget Studio's preview environment.
accentColorstringOptional
Default hex accent color (e.g. "#0EA5E9"), surfaced via theme.accent and "theme.accent".
minimumAppVersionstringOptional
Minimum Deskset app version required (e.g. "1.3.0").
entrystringOptional
Entry TS/TSX/JS file path. Defaults to "index.tsx".
optionsobjectOptional
Map of user-editable settings (fields defined in §4 below) automatically rendered in the Edit Widget sheet and readable via useWidget().settings or useSetting.

3. Default Sizes & sizeDimensions#

Standard canvas sizes in macOS logical points (pt):

  • small: 164 × 164 pt
  • medium: 344 × 164 pt
  • large: 344 × 344 pt
  • custom: 420 × 220 pt (freely resizable or constrained via sizeDimensions)

Each entry inside sizeDimensions accepts:

widthnumberOptional
Initial canvas width in points.
heightnumberOptional
Initial canvas height in points.
minWidthnumberOptional
Minimum resizable width in points.
minHeightnumberOptional
Minimum resizable height in points.
maxWidthnumberOptional
Maximum resizable width in points (clamped to screen bounds).
maxHeightnumberOptional
Maximum resizable height in points (clamped to screen bounds).

4. options Schema#

Every key inside options automatically generates a native macOS control in both the right-click Edit Widget panel and Widget Studio's Live Options Debugger. To localize option labels and choice picker titles across unlimited languages (e.g. Japanese, Korean, German), define _meta.options inside each locales/<tag>.json file — see Localization (locales/).

typestringRequired
Control type: "string" (text input), "number" (slider/stepper), "boolean" (toggle), "choice" (picker), or "color" (color well).
labelstringOptional
Default display label.
labelZhstringOptional
Simplified Chinese label shown on Chinese macOS locales.
labelEnstringOptional
English label shown on English macOS locales.
defaultanyOptional
Default value matching type.
minnumberOptional
For number options: lower numeric bound.
maxnumberOptional
For number options: upper numeric bound.
choicesstring[]Optional
For choice options: allowed string values enforced on read and useSetting write.
groupstringOptional
Optional section group in the Edit Widget sheet: "content", "interaction", or "desktop".
ordernumberOptional
Display sort order inside the Edit Widget sheet (lower numbers appear first).

5. Complete Template#

JSON
{
  "$schema": "https://ideskset.com/docs/deskpack.schema.json",
  "id": "com.you.github-stars",
  "name": "GitHub Stars",
  "nameZh": "GitHub 星标追踪",
  "version": "1.0.0",
  "description": "Live star and issue counts for any public repository",
  "descriptionZh": "在桌面实时追踪任意公开仓库的 Star 与 Issue 数",
  "defaultLocale": "en",
  "author": "@you",
  "category": "productivity",
  "icon": "star.fill",
  "sizes": ["small", "medium", "custom"],
  "styles": ["glass", "minimal"],
  "sizeDimensions": {
    "custom": {
      "width": 440,
      "height": 200,
      "minWidth": 280,
      "minHeight": 140,
      "maxWidth": 640,
      "maxHeight": 320
    }
  },
  "accentColor": "#0071E3",
  "minimumAppVersion": "1.3.0",
  "options": {
    "repo": {
      "type": "string",
      "label": "Repository",
      "labelZh": "仓库路径",
      "labelEn": "Repository",
      "default": "swiftlang/swift",
      "group": "content",
      "order": 1
    },
    "refreshMinutes": {
      "type": "number",
      "label": "Refresh (min)",
      "labelZh": "刷新间隔(分钟)",
      "labelEn": "Refresh (min)",
      "default": 15,
      "min": 5,
      "max": 120,
      "group": "content",
      "order": 2
    },
    "layout": {
      "type": "choice",
      "label": "数据样式",
      "labelEn": "Metric Style",
      "choices": ["compact", "detailed"],
      "default": "detailed",
      "order": 3
    },
    "showForks": {
      "type": "boolean",
      "label": "显示 Fork 数",
      "labelEn": "Show Forks",
      "default": true,
      "order": 4
    },
    "tint": {
      "type": "color",
      "label": "强调色",
      "labelEn": "Accent Color",
      "default": "#0071E3",
      "order": 5
    }
  }
}