Field type
spacing
Preset spacing scale (None / S / M / L) with a custom-value escape hatch. Stores either a preset key or a CSS length string.
Type: spacing · Stored attribute type: string
Stored value
string — one of "none" | "small" | "medium" | "large", OR a CSS length like "2rem" when the custom escape hatch is used.
Supports
- Toggle-group of presets (defaults: None / S / M / L)
- Custom CSS-length input with validation
- Configurable preset list
Config options
| Option | Type | Default | Description |
|---|---|---|---|
presets | { value, label }[] | [{ value: "none", label: "None" }, { value: "small", label: "S" }, { value: "medium", label: "M" }, { value: "large", label: "L" }] | Override the preset toggle group. |
Gotchas
- Stored value is EITHER a preset key (
"medium") OR a CSS length ("2rem"). The renderer must map preset keys to your spacing scale before applying. - Custom values must match
^(\d*\.?\d+)(px|rem|em|%|vw|vh|vmin|vmax)?$— invalid input is rejected with an inline warning.
Example
{ "id": "ctrl_gap",
"type": "spacing",
"label": "Section gap",
"attributeKey": "gap",
"default": "medium",
"parentPanelId": "panel" }Every field also takes the keys common to all fields.