Overview
FormBuilder out of the box supports conditional rendering for components. For this purpose, a special component property renderWhen is used. The value of the property is treated as an expression that should returntrue when the component needs to be rendered. The expression in
this case is the function text, without the return keyword. A form variable of
type IFormData is available in the body of the expression, just as it is
in computed properties.
You can also make the property computed if you want to write a full function that calculates whether the component should be displayed.
Example
Create a simple form with two controls:- A checkbox with the
checkboxkey. - Button (the key of this component does not matter for us).

SampleForm.json
true. The button will not
render if the value is not true. The button will also not be in the DOM tree.


Next steps
- Designer Actions — Trigger actions when conditions change
- Core Conditional Logic — Learn conditional rendering in FormEngine Core