Template Expressions
Add sophisticated presentation logic to your LWC template files, and remove extra code from your component implementation. Beginning in Spring ’26, a component that renders a user interface can use complex JavaScript expressions directly in its HTML template file. Use complex template expressions anywhere you use basic properties.
Complex template expressions is a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer's sole discretion.
Do not use complex template expressions in production. See Considerations and Limitations for additional cautions.
One superpower of Lightning Web Components is its templating system, which uses the virtual DOM to render components intelligently and efficiently. Complex template expressions extends this capability to include a comprehensive subset of JavaScript expressions, enabling more dynamic and expressive templates while maintaining LWC’s performance characteristics and security model.
Complex template expressions can be used wherever basic properties are supported. Set the apiVersion of your component to 66.0 or later to enable complex template expressions for that component.