Skip to content

Widget fields reference ​

A widget (a theme's fields.json, a site block, or a built-in component) declares its editable props as a JSON-Schema subset. The same schema drives three things at once: the visual editor's Inspector form, AI generation, and validation — a schema that uses a format or keyword outside this page is rejected on save.

This page is generated at build time from the platform's field contract (revision 19d95918), so it always matches what the platform accepts.

Shape ​

json
{
    "$schema": "https://docs.onivos.com/schemas/website-widget-fields.schema.json",
    "type": "object",
    "properties": {
        "title": { "type": "string", "title": "Title", "group": "Content" },
        "cta": { "type": "object", "format": "link", "title": "Button" },
        "plans": {
            "type": "array",
            "title": "Plans",
            "items": {
                "type": "object",
                "properties": {
                    "name": { "type": "string", "title": "Plan" },
                    "price": { "type": "string", "title": "Price", "displayWidth": "half" }
                }
            }
        }
    },
    "required": ["title"]
}

Point $schema at the URL above to get autocomplete and validation in your editor while building themes with the CLI.

  • A type: "object" field with properties renders as a nested form; with a format (like link or font) it renders that composite editor instead.
  • A type: "array" whose items is an object renders as a repeater (drag-reorder, duplicate, collapse); with items.enum it renders as a multi-select.
  • A plain enum renders as a choice — values that are all alignment keywords auto-upgrade to the alignment toggle.

Field types (format) ​

format picks the editor when type alone is ambiguous. Live-option formats (menu, page, article, record) get their choices injected by the builder — never list options in the schema.

formaton typestored valuenotesexample
textareastringstringPlain multi-line text.Every plan includes onboarding.
richtextstringHTML stringWYSIWYG-edited HTML (sanitized on render).<p>We ship <strong>fast</strong>.</p>
codestringstringSource code in a CodeMirror editor. Extra keywords: language.<div class="badge">New</div>
unitstring | numberstring ('16px')A number with a CSS unit; min+max unlock a slider. Extra keywords: units, min, max, step.16px
multiselectarraystring[]Pick several from a fixed option list (options on `items.enum`).["seo","ads"]
tagsarraystring[]Free-form tag list with optional suggestions. Extra keywords: suggestions.["sale","featured"]
colorstringstring (CSS color)A CSS color value.#7c3aed
gradientstringstring (CSS gradient)A CSS gradient value.linear-gradient(90deg, #7c3aed, #db2777)
fontobjectobjectFont family/size/weight as an object; the widget Liquid reads sub-props.{"family":"'Inter', sans-serif","size":"18px","weight":"600"}
fontFamilystringstring (CSS font stack)One family picked from the Google Fonts catalog (./web-fonts), stored as a CSS stack. Self-hosted at publish — see docs/plans/web-fonts.md.'Inter', system-ui, sans-serif
alignmentstringstring (left|center|right|justify)Segmented icon toggle. A plain enum whose values are all alignment keywords renders as this automatically.center
borderstringstring (CSS border shorthand)Width/style/color as one CSS shorthand string.1px solid #e5e7eb
spacingstringstring (CSS box shorthand)Four-side margin/padding editor emitting a CSS shorthand.16px 24px
cornersstringstring (CSS radius shorthand)Per-corner radius editor emitting a CSS shorthand.8px 8px 0 0
iconstringstring (PrimeIcons name)Icon picker over the PrimeIcons set.pi-bolt
imagestringURL stringImage URL with a media-library picker.https://cdn.example.com/hero.jpg
videostringURL or embed-HTML stringAlias of embed.https://www.youtube.com/watch?v=xyz
embedstringURL or embed-HTML stringExternal media by URL or pasted embed snippet.https://www.youtube.com/watch?v=xyz
linkobject{ href, target?, rel? }Internal-page or external link; the widget Liquid reads sub-props (props.cta.href).{"href":"/pricing","target":"_self"}
datestringISO date stringDate picker.2026-08-01
datetimestringISO datetime stringDate + time picker.2026-08-01T18:00:00Z
urlstringURL stringText input with URL keyboard/validation.https://onivos.com
emailstringstringText input with email keyboard/validation.[email protected]
phonestringstringText input with tel keyboard.+84 28 1234 5678
mapobjectobject (string→string)Free-form key→value editor.{"utm_source":"newsletter"}
jsonobject | array | stringany JSONRaw JSON in a code editor.{"columns":3}
menustringmenu id stringPicks one of the site's navigation menus; the builder injects live options.73020331450368001
globalstringglobal module handlePicks one of the site's reusable global modules by handle; the builder injects live options.promo-banner
pagestringpage id stringPicks one of the site's pages; the builder injects live options.73020331450368002
articlestringarticle id stringPicks one of the site's blog articles; the builder injects live options.73020331450368003
recordstringrecord id stringPicks a data-object record (declare the object with the `object` keyword); the builder injects live options. Extra keywords: object.73020331450368004
formstringform id stringPicks one of the site's forms; the builder injects live options.73020331450368005
productstringproduct id stringPicks a commerce product; the builder injects live options.73020331450368006
crmobject-propertystringfield key stringPicks a FIELD (not a record) of a data object — declare the object with the `object` keyword; the builder injects live options. Extra keywords: object.title

Without a format, the bare type decides the editor:

typerenders as
stringtext
integernumber
numbernumber
booleanboolean
objectobject
arraymultiselect

Keywords ​

keywordmeaning
typeJSON-Schema type; defaults to "string" when omitted.
titleLabel shown above the input.
formatSelects the renderer (a FORMATS key) when `type` alone is ambiguous.
defaultDefault value — also drives the per-field reset affordance and the unit slider rest value.
enumChoice options: ['a','b'] or [{label,value}]. On an array field, put it on `items.enum` (multiselect).
displayChoice presentation: select | buttons | radio | checkbox. Small string enums (≤4) default to buttons.
groupBuckets the field into a collapsible section of the form.
displayWidth'half' → two fields share a row.
requiredMarks the field required (asterisk). Root-level `required: []` array works too.
helpHelper text under the input (alias: inlineHelp).
inlineHelpAlias of help.
visibility{ field, operator?, value? } — show only when a sibling matches (operator: eq (default) | neq | in | truthy) — OR a composite { all: [rules] } / { any: [rules] } for AND/OR of nested rules.
placeholderInput placeholder.
unitsformat:unit — allowed unit list, e.g. ['px','rem']. First entry is the default.
minformat:unit — slider lower bound (with max, unlocks the slider). For a plain number field use `minimum`.
maxformat:unit — slider upper bound.
stepformat:unit — slider increment.
minimumJSON-Schema numeric value lower bound (AI generation honors it; the editor does not).
maximumJSON-Schema numeric value upper bound.
minLengthJSON-Schema string length lower bound.
maxLengthJSON-Schema string length upper bound.
patternJSON-Schema regex the string value must match; the editor validates it live (AI generation honors it too).
patternMessageThe error message shown when `pattern` fails (falls back to a generic one).
lockedDeveloper-set value a content editor cannot change — the field renders read-only with a lock hint.
minItemstype:array repeater — minimum item count (the editor blocks removing below it; AI honors it).
maxItemstype:array repeater — maximum item count (the editor blocks Add above it; AI honors it).
objectformat:record — key of the data object to pull records from.
suggestionsformat:tags — autocomplete suggestions.
languageformat:code — editor language (default 'html').
propertiestype:object — nested field map (rendered as a nested form).
itemstype:array — item schema: `{enum}` → multiselect, `{type:"object",properties}` → repeater.

Style fields ​

A CLI widget may include a styles object group in its fields.json; it becomes the widget's Style tab schema (otherwise every widget gets the standard spacing / background / typography / border / effects form). Style values live on the page node, not in your widget's props, and only whitelisted CSS properties are emitted.