Set prop settings (Beta)
Set prop settings (Beta)
component.setProp(propId, updates)
Updates one or more settings on an existing prop.
Only the settings that you pass to this method change.
This method returns the full updated Prop object, not only properties that changed.
To clear a setting, pass undefined as its new value.
This action is undoable in the Webflow Designer.
A prop’s type cannot be changed after creation. Passing a type field returns an error.
Beta
These methods are in public beta and may change with future releases.
Syntax
Parameters
The method accepts two call signatures: an ID string plus an updates object or a single object that includes the id field.
SetPropOptions — all fields are optional:
propId: string — The unique ID of the prop to update (first-argument signature only).updates.name: string — (optional) The new display name. If a prop with the same name already exists in the same group, the name is automatically incremented (for example,HeadingbecomesHeading 2).updates.group: string | null — (optional) Move the prop to a different group, or passnullto remove it from its group.updates.tooltip: string | null — (optional) New tooltip text, ornullto remove the tooltip.updates.defaultValue: varies by type — (optional) New default value. The shape must match the prop’s type. Passnullto clear the default value.updates.multiline: boolean — ('textContent'only, optional) Whether the text input supports multiple lines.updates.min: number | null — ('number'only, optional) Minimum allowed value. Passnullto remove the constraint.updates.max: number | null — ('number'only, optional) Maximum allowed value. Passnullto remove the constraint.updates.decimals: number | null — ('number'only, optional) Number of decimal places allowed. Passnullto remove the constraint.updates.trueLabel: string | null — ('boolean'only, optional) Label shown when the value istrue. Passnullto remove the label.updates.falseLabel: string | null — ('boolean'only, optional) Label shown when the value isfalse. Passnullto remove the label.
Returns
Promise<Prop>
A Promise that resolves to the full updated Prop object after the update is applied.
The Prop interface uses the same shape as the return value of component.createProp():
Examples
Update the default value of a link prop:
Update a prop name and tooltip using the object-with-ID signature:
Update number constraints:
Move a prop to a different group:
Remove a prop from its group:
Remove a tooltip: