Switch - xkp/Doc GitHub Wiki

Overview

The switch component is a simple container that will only show one of its children at a time. This allows behavior like tab controls to be implemented.

Properties

active: the index of the component to be shown.

Usage

<switch id="my_switch">
   <div>
      <img src="img1.png"/>
   </div>
   <div>
      <img src="img2.png"/>
   </div>
</switch>

In this case only one image will be shown, depending on the switch's active property.

⚠️ **GitHub.com Fallback** ⚠️