Skip to main content

ShapePropertyDefinition

Defines a single configurable property exposed by a shape.

Properties​

booleanLabels?​

optional booleanLabels: [string, string]

Specifies the labels to use for this property if it is a boolean and you've specified you want a 'radio' or 'select' editor. You could use this, for example, to show "On/Off" or "Yes/No" labels in the UI, rather than "True/False".


defaultValue?​

optional defaultValue: any

The default value for this property if it hasn't been explicitly set.


description?​

optional description: string

Optional description or tooltip to help the user understand what this property does.


editor?​

optional editor: "select" | "radio"

Specifies the type of UI input to use to manage the property. Only used if you have supplied values, or if the property type is "boolean" (since in that case the property's values are implicitly a list, containing true and false values).


id​

id: string

The internal variable name used in the template (e.g., "backgroundColor", "width").


label​

label: string

The human-readable name to display in the inspector UI (e.g., "Background Color").


max?​

optional max: number

For "number" types, optional max constraints.


min?​

optional min: number

For "number" types, optional min constraints.


readOnly?​

optional readOnly: boolean

If true, inspectors display this property's value without an editable control.


type​

type: ShapePropertyType

The data type of the property, telling the inspector which UI control to render by default. For properties that include a values array (and also properties of type boolean) you can override the choice of UI control via the editor option.


values?​

optional values: (string | ShapePropertyValueDefinition)[]

Optional set of values to pick current value from