Remove a prop (Beta)

component.removeProp(propId)

Removes a prop from a component by its ID.

This method removes the prop definition and disconnects any bindings on component instances that reference it. This action mirrors the delete action available in the component props panel in the Webflow Designer and is undoable.

Beta

These methods are in public beta and may change with future releases.

Syntax

1component.removeProp(propId: string): Promise<null>

Parameters

  • propId : string — The unique ID of the prop to remove.

Returns

Promise<null>

A Promise that resolves to null when the prop has been removed.

Examples

Remove a prop found by name:

1const component = await webflow.getCurrentComponent()
2
3if (component) {
4 const props = await component.getProps()
5 const unusedProp = props.find(p => p.name === 'Old Heading')
6
7 if (unusedProp) {
8 await component.removeProp(unusedProp.id)
9 // Prop is deleted
10 }
11}

Remove a prop by its known ID:

1const component = await webflow.getCurrentComponent()
2
3if (component) {
4 await component.removeProp('prop_123')
5}

Create a prop and then remove it:

1const component = await webflow.getCurrentComponent()
2
3if (component) {
4 const temp = await component.createProp({
5 type: 'string',
6 name: 'Temporary',
7 })
8
9 await component.removeProp(temp.id)
10}

Designer Ability

Designer AbilityPermissionLocaleBranchWorkflowSitemode
canModifyComponentsanyanyanyCanvasDesign