1e41f4b71Sopenharmony_ci# Adding a Container
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ciTo assemble the basic elements of a page, you need a container component. The <div>, <list>, and <tabs> components are commonly used for laying out page elements. You can use <div> as the container in a page with simple layout. <div> supports a variety of child components required to build the page.
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci## <List>
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ciIf you use <div> repeatedly to render a complex page, frame freezing may occur. In this case, use the <list> component instead of <div> to lay out list items, which provides a smooth list scrolling. **NOTE** that <list> supports only <list-item> as it child components. The following is an example:
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci```html
12e41f4b71Sopenharmony_ci<!-- xxx.hml -->
13e41f4b71Sopenharmony_ci<list class="list">
14e41f4b71Sopenharmony_ci  <list-item type="listItem" for="{{textList}}">
15e41f4b71Sopenharmony_ci    <text class="desc-text">{{$item.value}}</text>
16e41f4b71Sopenharmony_ci  </list-item>
17e41f4b71Sopenharmony_ci</list>
18e41f4b71Sopenharmony_ci```
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ci```css
21e41f4b71Sopenharmony_ci/* xxx.css */
22e41f4b71Sopenharmony_ci.desc-text {
23e41f4b71Sopenharmony_ci  width: 683.3px;
24e41f4b71Sopenharmony_ci  font-size: 35.4px;
25e41f4b71Sopenharmony_ci}
26e41f4b71Sopenharmony_ci```
27e41f4b71Sopenharmony_ci
28e41f4b71Sopenharmony_ci```js
29e41f4b71Sopenharmony_ci// xxx.js
30e41f4b71Sopenharmony_ciexport default {
31e41f4b71Sopenharmony_ci  data: {
32e41f4b71Sopenharmony_ci    textList:  [{value: 'JS FA'}],
33e41f4b71Sopenharmony_ci  },
34e41f4b71Sopenharmony_ci}
35e41f4b71Sopenharmony_ci```
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ciTo shorten the sample code, the list contains only one &lt;list-item&gt; component that holds only one &lt;text&gt; component. In practice, a &lt;list&gt; has multiple &lt;list-item&gt; components, and a &lt;list-item&gt; has multiple child components.
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ci
40e41f4b71Sopenharmony_ci## &lt;Tabs&gt;
41e41f4b71Sopenharmony_ci
42e41f4b71Sopenharmony_ciIf your page needs to be dynamically loaded, use the &lt;tabs&gt; component. This component supports the change event, which is triggered after tab switching. A &lt;tabs&gt; component can hold only one &lt;tab-bar&gt; and one &lt;tab-content&gt;. The following is an example:
43e41f4b71Sopenharmony_ci
44e41f4b71Sopenharmony_ci```html
45e41f4b71Sopenharmony_ci<!-- xxx.hml -->
46e41f4b71Sopenharmony_ci<tabs>
47e41f4b71Sopenharmony_ci  <tab-bar>
48e41f4b71Sopenharmony_ci    <text>Home</text>
49e41f4b71Sopenharmony_ci    <text>Index</text>
50e41f4b71Sopenharmony_ci    <text>Detail</text>
51e41f4b71Sopenharmony_ci  </tab-bar>
52e41f4b71Sopenharmony_ci  <tab-content>
53e41f4b71Sopenharmony_ci    <image src="{{homeImage}}"></image>
54e41f4b71Sopenharmony_ci    <image src="{{indexImage}}"></image>
55e41f4b71Sopenharmony_ci    <image src="{{detailImage}}"></image>
56e41f4b71Sopenharmony_ci  </tab-content>
57e41f4b71Sopenharmony_ci</tabs>
58e41f4b71Sopenharmony_ci```
59e41f4b71Sopenharmony_ci
60e41f4b71Sopenharmony_ci```js
61e41f4b71Sopenharmony_ci// xxx.js
62e41f4b71Sopenharmony_ciexport default {
63e41f4b71Sopenharmony_ci  data: {
64e41f4b71Sopenharmony_ci    homeImage: '/common/home.png',
65e41f4b71Sopenharmony_ci    indexImage: '/common/index.png',
66e41f4b71Sopenharmony_ci    detailImage: '/common/detail.png',
67e41f4b71Sopenharmony_ci  },
68e41f4b71Sopenharmony_ci}
69e41f4b71Sopenharmony_ci```
70e41f4b71Sopenharmony_ci
71e41f4b71Sopenharmony_ciThe &lt;tab-content&gt; component is used to display the tab content, which vertically fills the remaining space of the &lt;tabs&gt; component by default. 
72