RIOT.JS - Có điều kiện
Điều kiện là cấu trúc được sử dụng để hiển thị / ẩn các phần tử của thẻ RIOT. Sau đây là ba điều kiện mà RIOT hỗ trợ:
- if - thêm / bớt phần tử dựa trên giá trị được truyền vào. 
<custom2Tag>
   <h2 if = {showMessage}>Using if!</h2>
   <script>
      this.showMessage = true;      
   </script>
</custom2Tag>- show - hiển thị một phần tử sử dụng style = "display:' ' "nếu được thông qua true. 
<custom2Tag>
   <h2 show = {showMessage}>Using show!</h2>
   <script>
      this.showMessage = true;      
   </script>
</custom2Tag>- hide - ẩn một phần tử bằng cách sử dụng style = "display:'none' "nếu được thông qua true. 
<custom2Tag>
   <h2 show = {showMessage}>Using show!</h2>
   <script>
      this.showMessage = true;      
   </script>
</custom2Tag>Thí dụ
Sau đây là ví dụ đầy đủ.
custom2Tag.tag
<custom2Tag>
   <h2 if = {showMessage}>Using if!</h2>
   <h2 if = {show}>Welcome!</h1>
   <h2 show = {showMessage}>Using show!</h2>
   <h2 hide = {show}>Using hide!</h2>
   <script>
      this.showMessage = true;
      this.show = false; 
   </script>
</custom2Tag>custom2.htm
<!DOCTYPE html>
<html>
   <head>
      <script src = "https://cdnjs.cloudflare.com/ajax/libs/riot/3.13.2/riot+compiler.min.js"></script>
   </head>
   <body>
      <custom2Tag></custom2Tag>
      <script src = "custom2Tag.tag" type = "riot/tag"></script>
      <script>
         riot.mount("custom2Tag");
      </script>
   </body>
</html>Điều này sẽ tạo ra kết quả sau: