Represents a command to set component material by its slot ID and Material ID.
To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
What does it unlock?
Sets a material variant for a component. Simulates selecting a different material from the menu for a specific component.
Practical Application
Applies a material to a specific slot on a component. Takes componentId (UUID), slotId (string), and materialId (UUID).
Use to build swatch pickers, apply preset themes/bundles, or sync material selections from an external
PIM/ERP system via externalId mapping.
AI Coding Best Practices
Get valid slotId and materialId values from the configuratorDataUpdated envelope —
check component slot definitions and material lists. Pattern:
new SetComponentMaterial('component-uuid', 'slot-name', 'material-uuid'). The referenced component must already be set in the tree.
//Subscribe to the event before sending the command to ensure you capture the response api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => { console.log('State updated after applied new material:', data); });
Represents a command to set component material by its slot ID and Material ID. To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
What does it unlock?
Sets a material variant for a component. Simulates selecting a different material from the menu for a specific component.
Practical Application
Applies a material to a specific slot on a component. Takes componentId (UUID), slotId (string), and materialId (UUID). Use to build swatch pickers, apply preset themes/bundles, or sync material selections from an external PIM/ERP system via externalId mapping.
AI Coding Best Practices
Get valid slotId and materialId values from the configuratorDataUpdated envelope — check component slot definitions and material lists. Pattern:
new SetComponentMaterial('component-uuid', 'slot-name', 'material-uuid'). The referenced component must already be set in the tree.Example
Param: componentId
The component ID.
Param: slotId
The slot ID.
Param: materialId
The material ID.