Conditionally hiding individual entities in non-Lovelace frontend?

Is there a way to hide individual entities unless certain conditions are met? Sort of like:

hidden: >
  {% if some condition %}
    true
  {% else %}
    false
  {% endif %}

I’m pretty sure the answer is there is no way to do it in the classic frontend. At least I haven’t found anything aside from putting the entity in a group and conditionally hiding the group.

Nevermind…

I figured out how to do it using custom-ui.

put the following in your customize section:

entity.to_hide:
  templates:
    hidden: "return (state === 'condition to hide on' );"