CardDeck provides the generic ability to switch between multiple views. Using it, you can create common UI components like tabbed notebooks and paged wizards.

One benefit of CardDeck is that the different panels it presents are created on the fly, using templates . Each card definition above is generated as a separate function, which when invoked will create the controls for that page. In this way, only those controls that are on cards the user requests are created. Many controls make use of templates - the List, for example, uses one or more templates to define how each list item will appear. This is a powerful construct that provides tremendous flexibility in UI design with little cost. We'll see more examples of the use of templates as we proceed.

The first example above simply moves between three cards, as a wizard might. To cycle through the cards, the buttons inside bubble the 'nextCard' and 'previousCard' events up to their containing card deck.

The second example suggests how you can create a tabbed notebook. The two tabs have their click handlers associated with setting the currentCard property of the card deck. We'll probably add a specific TabControl in the future, but the CardDeck demo here shows how composable Jitsu controls are.