Marko.js provides if
, else-if
, and else directives for conditional rendering. Here's an example:
<template>
<if(input.isLoggedIn)>
<p>Welcome back, ${input.username}!</p>
</if>
<else>
<p>Please log in.</p>
</else>
</template>
Depending on the value of input.isLoggedIn, either the welcome message or the login prompt will be rendered.