Templates
Some configuration options and item properties admit templates. Custom Sidebar admits two templating systems, JavaScript templates or Jinja templates. JavaScript templates are processed faster because the rendering is done in the device, Jinja templates depend on the response of WebSocket calls to receive the template result. Another difference is that JavaScript templates use a single subscribe_events WebSocket subscription to detect state changes and this subscription is used for all the templates, but Jinja templates need to create a render_template WebSocket subscription per template. In general terms, you should not notice many differences between the two in terms of performance. The main differences between the two templating systems (apart from the syntax) are that JavaScript can access client side data like DOM APIs, can return Promises, can work with Reactive JavaScript Variables and can execute several JavaScript methods like opening dialogs or call services. Jinja templates do not have all these features.
JavaScript Templates
1 item
Jinja Templates
This templating system is the same that Home Assistant implements. You can use the majority of the template methods and objects. The entire template will be processed, rendered and the result will be used as the desired option. If you don't want to display anything in certain scenarios, you should return an empty string in those cases. The next client side variables will be available in Jinja templates: