Skip to main content
The Stac Conditional allows you to conditionally render widgets based on a boolean expression. It evaluates the condition at runtime and renders either the ifTrue or ifFalse widget.

Properties

Example

Conditional with Complex Widgets

Condition Expression Syntax

The condition property accepts expressions that are evaluated against the current state. Common patterns include:
  • Equality: user.role == 'admin'
  • Boolean check: user.isVerified == true
  • Comparison: cart.total > 100
  • Length check: items.length > 0
  • Null check: user.name != null
The condition is evaluated at runtime by Stac’s expression resolver against the current application state.