Example: Custom Lightning Web Component to Standard Flow Component
Make your custom text component react to a standard Flow component.
- Create a public field with the
@apidecorator as referenced incustomText.jsexample. - Add the target configuration in the
.js-meta.xmlfile with the appropriate type as referenced in thecustomText.js-meta.xmlexample. - Add an input field attached with an event handler to store the user input.
- In the event handler, fire a
FlowAttributeChangeevent defined in theflow-supportcomponent. TheFlowAttributeChangeevent name must match the name of the public field in order for reactivity to work. Due to the nature of the Flow Runtime, the setter method is called after theFlowAttributeChangeevent is fired and it is invoked when reactivity leads to a change to the public field. - After you create the custom component, add the component to the Flow builder with a label.
- To make the Text component react to the custom component, configure the default value’s source on the Text component to the custom component’s public property.
See Also