1e41f4b71Sopenharmony_ci# slot
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci>  **NOTE**
4e41f4b71Sopenharmony_ci>
5e41f4b71Sopenharmony_ci>  The APIs of this module are supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ci## Default Slot
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ciYou can use the **\<slot>** tag to create a slot inside a custom component to fill the content defined in the parent component. The sample code is as follows:
11e41f4b71Sopenharmony_ci
12e41f4b71Sopenharmony_ci```html
13e41f4b71Sopenharmony_ci<!-- comp.hml -->
14e41f4b71Sopenharmony_ci<div class="item">  
15e41f4b71Sopenharmony_ci   <text class="text-style">The following uses the content defined in the parent component.</text> 
16e41f4b71Sopenharmony_ci   <slot></slot> 
17e41f4b71Sopenharmony_ci</div>
18e41f4b71Sopenharmony_ci```
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ciThe following references the custom component:
21e41f4b71Sopenharmony_ci```html
22e41f4b71Sopenharmony_ci<!-- xxx.hml --> 
23e41f4b71Sopenharmony_ci <element name='comp' src='../common/component/comp.hml'></element>  
24e41f4b71Sopenharmony_ci <div class="container">  
25e41f4b71Sopenharmony_ci   <comp>
26e41f4b71Sopenharmony_ci     <text class="text-style">Content defined in the parent component</text>
27e41f4b71Sopenharmony_ci   </comp>  
28e41f4b71Sopenharmony_ci </div>
29e41f4b71Sopenharmony_ci```
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci
32e41f4b71Sopenharmony_ci## Named Slot
33e41f4b71Sopenharmony_ci
34e41f4b71Sopenharmony_ciWhen multiple slots are need inside a custom component, you can name them, so that you can specify the slot in which you want to fill content by setting the **\<name>** attribute.
35e41f4b71Sopenharmony_ci
36e41f4b71Sopenharmony_ci```html
37e41f4b71Sopenharmony_ci<!-- comp.hml -->
38e41f4b71Sopenharmony_ci<div class="item">  
39e41f4b71Sopenharmony_ci   <text class="text-style">The following uses the content defined in the parent component.</text> 
40e41f4b71Sopenharmony_ci   <slot name="first"></slot>
41e41f4b71Sopenharmony_ci   <slot name="second"></slot> 
42e41f4b71Sopenharmony_ci</div>
43e41f4b71Sopenharmony_ci```
44e41f4b71Sopenharmony_ci
45e41f4b71Sopenharmony_ciThe following references the custom component:
46e41f4b71Sopenharmony_ci```html
47e41f4b71Sopenharmony_ci<!-- xxx.hml --> 
48e41f4b71Sopenharmony_ci <element name='comp' src='../common/component/comp.hml'></element>  
49e41f4b71Sopenharmony_ci <div class="container">  
50e41f4b71Sopenharmony_ci   <comp>
51e41f4b71Sopenharmony_ci     <text class="text-style" slot="second">Fill in the second slot.</text> 
52e41f4b71Sopenharmony_ci     <text class="text-style" slot="sfirst">Fill in the first slot.</text>
53e41f4b71Sopenharmony_ci   </comp>  
54e41f4b71Sopenharmony_ci </div>
55e41f4b71Sopenharmony_ci```
56e41f4b71Sopenharmony_ci
57e41f4b71Sopenharmony_ci>  **NOTE**
58e41f4b71Sopenharmony_ci>
59e41f4b71Sopenharmony_ci>  **\<name>** and **\<slot>** do not support dynamic data binding.
60