# Tab Container (tab-container)

## Properties

1. activeIndex (value-property)

- The current zero-based index of the active card.
- When this value changes, the data of this component also changes accordingly.

## Example

Attach events to the rectangle components to control the active card in the Tab Container (TabContainer).

> - **Attach a click event to the rectangle components and pass it to the Tab Container (TabContainer).**
> - **Change the value property of the Tab Container (TabContainer), and the Tab Card will be updated.**

![gif][gif-01]

[gif-01]: ../images/tab-button-finish-01.gif

1. Create a Tab Container (TabContainer) with three layers.

![Tab Container (TabContainer)][tab-container-create]

2. Add text to each layer for distinction.

![Tab Container (TabContainer)][tab-container-text]

3. Set the ID of the Tab Container (TabContainer) to 'indoor'.

![Tab Container (TabContainer)][tab-container-id]

4. Add button events

- Draw three rectangles and select 'indoor' in the variable information from the 'Effects Pane'.
  (Variable information shows the default events and a list of component IDs.)
  ![Button Events][button-02]

- Map values for each rectangle. (When you click a rectangle, it passes the data '0' to the component with the 'indoor' ID.)
  - 1st layer - 0
  - 2nd layer - 1
  - 3rd layer - 2

![Button Events][button-03]

[button-02]: ../images/button-evnet-mapping-02.png
[button-03]: ../images/button-evnet-mapping-03.png

5. Tab Container (TabContainer) Configuration

- Configure the data binding settings of the Tab Container (TabContainer) component as shown in the image below.  
  (Change its value property when receiving data.)

![Button Events][tab-container-setting]

6. Check the Result

- Once all the settings are completed, you can observe that **the Tab Container (TabContainer) changes its layer every time you click a rectangle**.
  ![gif-01]

[gif-01]: ../images/tab-button-finish-01.gif
