Language

Control flow

Author conditions, keyed iteration, switches, loading states, and error boundaries as native template operations.

source

Aligned if, elseif, and else branches compile directly to Octane @if control flow.

Status.btsxbtsx
if status === "ready"  ReadyViewelseif status === "loading"  LoadingViewelse  ErrorView

Loops compile to native @for blocks. Beast never invents an index key because keys affect rendering and hook identity.

Catalog.btsxbtsx
each result, index in results key result.id  SearchResult(result={result} position={index})empty  p No matches.
Variant.btsxbtsx
switch status  case "ready"    ReadyView  case "loading"    LoadingView  default    ErrorView

A try arm can be followed by pending, catch, or both. These compile directly to Octane template boundaries.

Profile.btsxbtsx
try  Profile(data={profileData})pending  p Loading profilecatch error, reset  .error    p Could not load profile: #{String(error)}    button(onClick={reset}) Try again