{{unless}}

Renders a block or value when the condition is falsy (the inverse of if).

Since Ember 4/5 (Octane) Spec ↗

Syntax

{{#unless cond}}...{{/unless}} | {{unless cond a b}}

Returns

block | value — The falsy branch or its inline value.

Examples

{{#unless this.session.isAuthenticated}}
  <LoginForm />
{{/unless}}
<span class={{unless @active "muted"}}>{{@label}}</span>

Notes

unless is sugar for a negated if. Avoid chaining unless with else if, as double negatives reduce readability; prefer {{#if}} in those cases.